solidity/test/libsolidity/semanticTests/immutable/getter_call_in_constructor.sol

18 lines
318 B
Solidity
Raw Normal View History

2020-04-02 15:13:31 +00:00
contract A {
uint immutable public x = 1;
uint public y;
constructor() public {
y = this.x();
}
}
contract C {
function f() public returns (bool) {
try new A() { return false; }
catch { return true; }
}
}
// ====
// EVMVersion: >=tangerineWhistle
// ----
// f() -> true