solidity/test/libsolidity/syntaxTests/viewPureChecker/immutable.sol

9 lines
267 B
Solidity
Raw Normal View History

2020-02-27 15:13:55 +00:00
contract B {
2020-03-10 17:15:50 +00:00
uint immutable x = 1;
2020-02-27 15:13:55 +00:00
function f() public pure returns (uint) {
return x;
}
}
// ----
2020-03-10 17:15:50 +00:00
// TypeError: (100-101): Function declared as pure, but this expression (potentially) reads from the environment or state and thus requires "view".