mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Immutables with literal values are pure.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
contract C {
|
||||
uint immutable x = 1;
|
||||
|
||||
function readX() internal view returns(uint) {
|
||||
function readX() internal pure returns(uint) {
|
||||
return x + 3;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,4 +5,3 @@ contract B {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 2527: (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