mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Validate immutable variables
This commit is contained in:
committed by
chriseth
parent
9a8ca6ca33
commit
ac7b31e559
@@ -1,8 +1,8 @@
|
||||
contract B {
|
||||
uint immutable x;
|
||||
uint immutable x = 1;
|
||||
function f() public pure returns (uint) {
|
||||
return x;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (96-97): Function declared as pure, but this expression (potentially) reads from the environment or state and thus requires "view".
|
||||
// TypeError: (100-101): Function declared as pure, but this expression (potentially) reads from the environment or state and thus requires "view".
|
||||
|
||||
Reference in New Issue
Block a user