solidity/test/libsolidity/syntaxTests/immutable/ctor_initialization_indirect_reading.sol
2022-04-01 23:41:18 -05:00

11 lines
249 B
Solidity

contract C {
uint immutable x;
constructor() {
x = f();
}
function f() public pure returns (uint) { return 3 + x; }
}
// ----
// TypeError 7733: (136-137='x'): Immutable variables cannot be read before they are initialized.