solidity/test/libsolidity/syntaxTests/immutable/reading_after_initialization_function.sol
2023-07-14 15:29:32 +02:00

17 lines
251 B
Solidity

contract C {
uint immutable x;
constructor()
{
readX();
x = 3;
readX();
}
function readX() public view returns(uint) {
return x;
}
}
// ----
// TypeError 7733: (141-142): Immutable variables cannot be read before they are initialized.