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

7 lines
314 B
Solidity
Raw Normal View History

contract C {
modifier m(uint _amount, uint _avail) { require(_avail >= _amount); _; }
function f() m(1 ether, msg.value) public view {}
}
// ----
2018-08-16 15:28:49 +00:00
// TypeError: (118-127): "msg.value" can only be used in payable public functions. Make the function "payable" or use an internal function to avoid this error.