solidity/test/libsolidity/syntaxTests/specialFunctions/abi_encode_structs.sol
2022-04-01 23:41:18 -05:00

19 lines
507 B
Solidity

pragma abicoder v1;
contract C {
struct S { uint x; }
S s;
struct T { uint y; }
T t;
function f() public view {
abi.encode(s, t);
}
function g() public view {
abi.encodePacked(s, t);
}
}
// ----
// TypeError 2056: (151-152='s'): This type cannot be encoded.
// TypeError 2056: (154-155='t'): This type cannot be encoded.
// TypeError 9578: (220-221='s'): Type not supported in packed mode.
// TypeError 9578: (223-224='t'): Type not supported in packed mode.