Validate immutable variables

This commit is contained in:
Mathias Baumann
2020-04-02 13:52:27 +02:00
committed by chriseth
parent 9a8ca6ca33
commit ac7b31e559
56 changed files with 898 additions and 14 deletions
@@ -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".