Report an error if immutables not assigned

This commit is contained in:
a3d4
2020-07-23 16:38:54 +02:00
parent 336fe94422
commit 5b54cfbed3
7 changed files with 48 additions and 8 deletions
@@ -0,0 +1,13 @@
contract C {
uint immutable x;
constructor() {
x = 0;
while (true)
{}
}
function f() external view returns(uint) { return x; }
}
// ====
// optimize-yul: true
// ----
// CodeGenerationError 1284: Some immutables were read from but never assigned, possibly because of optimization.