solidity/test/libsolidity/syntaxTests/viewPureChecker/immutable.sol
2020-03-12 17:11:24 +01:00

9 lines
261 B
Solidity

contract B {
uint immutable x;
function f() public pure returns (uint) {
return x;
}
}
// ----
// TypeError: (96-97): Function declared as pure, but this expression (potentially) reads from the environment or state and thus requires "view".