solidity/test/libsolidity/syntaxTests/immutable/runtimeCodeInheritance.sol

14 lines
330 B
Solidity
Raw Normal View History

contract Base {
address public immutable user = address(0x0);
}
contract Derived is Base {}
contract Test {
function test() public pure returns(bytes memory) {
return type(Derived).runtimeCode;
}
}
// ----
// TypeError: (185-210): "runtimeCode" is not available for contracts containing immutable variables.