solidity/test/libsolidity/syntaxTests/memberLookup/msg_value_modifier_pure.sol
2022-04-01 23:41:18 -05:00

7 lines
311 B
Solidity

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