diff options
Diffstat (limited to 'test/libsolidity/syntaxTests/viewPureChecker/msg_value_modifier_view.sol')
-rw-r--r-- | test/libsolidity/syntaxTests/viewPureChecker/msg_value_modifier_view.sol | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/libsolidity/syntaxTests/viewPureChecker/msg_value_modifier_view.sol b/test/libsolidity/syntaxTests/viewPureChecker/msg_value_modifier_view.sol new file mode 100644 index 00000000..613b0198 --- /dev/null +++ b/test/libsolidity/syntaxTests/viewPureChecker/msg_value_modifier_view.sol @@ -0,0 +1,6 @@ +contract C { + modifier m(uint _amount, uint _avail) { require(_avail >= _amount); _; } + function f() m(1 ether, msg.value) public view {} +} +// ---- +// 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. |