solidity/test/libsolidity/semanticTests/immutable/getter_call_in_constructor.sol
2020-11-11 17:52:50 +01:00

19 lines
334 B
Solidity

contract A {
uint immutable public x = 1;
uint public y;
constructor() {
y = this.x();
}
}
contract C {
function f() public returns (bool) {
try new A() { return false; }
catch { return true; }
}
}
// ====
// compileViaYul: also
// EVMVersion: >=tangerineWhistle
// ----
// f() -> true