solidity/test/libsolidity/syntaxTests/viewPureChecker/msg_value_modifier.sol
2020-01-08 16:12:06 +01:00

7 lines
304 B
Solidity

contract C {
modifier m(uint _amount, uint _avail) { require(_avail >= _amount); _; }
function f() m(1 ether, msg.value) public pure {}
}
// ----
// TypeError: (118-127): Function declared as "pure", but this expression (potentially) reads from the environment or state and thus requires "view".