mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Report an error if immutables not assigned
This commit is contained in:
@@ -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.
|
||||
Reference in New Issue
Block a user