mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
17 lines
255 B
Solidity
17 lines
255 B
Solidity
|
contract C {
|
||
|
uint immutable x ;
|
||
|
|
||
|
constructor()
|
||
|
{
|
||
|
readX();
|
||
|
x = 3;
|
||
|
readX();
|
||
|
}
|
||
|
|
||
|
function readX() public view returns(uint) {
|
||
|
return x;
|
||
|
}
|
||
|
}
|
||
|
// ----
|
||
|
// TypeError 7733: (145-146): Immutable variables cannot be read before they are initialized.
|