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

19 lines
334 B
Solidity
Raw Normal View History

2020-04-02 15:13:31 +00:00
contract A {
uint immutable public x = 1;
uint public y;
2020-06-23 12:14:24 +00:00
constructor() {
2020-04-02 15:13:31 +00:00
y = this.x();
}
}
contract C {
function f() public returns (bool) {
try new A() { return false; }
catch { return true; }
}
}
// ====
2020-11-11 16:38:56 +00:00
// compileViaYul: also
2020-04-02 15:13:31 +00:00
// EVMVersion: >=tangerineWhistle
// ----
// f() -> true