mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Issue error for callvalue in nonpayable function
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
contract C
|
||||
{
|
||||
function () external {
|
||||
uint x;
|
||||
assembly {
|
||||
x := callvalue()
|
||||
}
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (92-103): "msg.value" and "callvalue()" can only be used in payable public functions. Make the function "payable" or use an internal function to avoid this error.
|
||||
Reference in New Issue
Block a user