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
@@ -0,0 +1,9 @@
contract C {
uint immutable x;
constructor() public {
if (false)
x = 1;
}
}
// ----
// TypeError: (93-94): Immutable variables must be initialized unconditionally, not in an if statement.