Confusing packable restriction for FAILWITH in 008
Environment (Mainnet, test network, build from source, ...)
v8.1 tezos-client binary from https://github.com/serokell/tezos-packaging/releases/tag/v8.1-1.
http://edo.testnet.tezos.serokell.team:8732/chains/main/blocks/head/ node
Summary
parameter (or (nat %A) (unit %default));
storage unit;
code {
SELF;
SELF %A;
SELF %default;
FAILWITH;
}
Contract is considered ill-typed on 008 protocol, with an error
contract type forbidden in storage and constants
While the following contract:
parameter (or (nat %A) (unit %default));
storage unit;
code {
SELF;
SELF %A;
SELF %default;
PACK;
FAILWITH;
}
Is considered well-typed, despite the fact that there is an attempt to pack the value with Contract ()
type.
So looks like the definition of the "packable type" is confusing
Expected behavior
"packable type" definition should be consistent
Actual behavior
Value with the "packable type" (the one that can be packed via PACK
) cannot be used with the FAILWITH
instruction.
Also, the error contract type forbidden in storage and constants
is a bit confusing