solidity/test/libsolidity/syntaxTests/imports/inheritance_abi_encoder_mismatch_1.sol

20 lines
587 B
Solidity
Raw Normal View History

2019-08-16 13:12:26 +00:00
==== Source: A.sol ====
pragma experimental ABIEncoderV2;
contract A
{
struct S { uint a; }
S public s;
function f(S memory _s) public returns (S memory,S memory) { }
}
==== Source: B.sol ====
pragma experimental ABIEncoderV2;
import "./A.sol";
contract B is A { }
==== Source: C.sol ====
import "./B.sol";
contract C is B { }
// ----
2019-12-11 16:05:44 +00:00
// TypeError: (C.sol:18-37): Contract "C" does not use ABIEncoderV2 but wants to inherit from a contract which uses types that require it. Use "pragma experimental ABIEncoderV2;" for the inheriting contract as well to enable the feature.