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

13 lines
543 B
Solidity
Raw Normal View History

contract C {
function f(address a) external view returns (bool success) {
(success,) = a.call{gas: 42}("");
}
function h() external payable {}
function i() external view {
this.h{gas: 42}();
}
}
// ----
2020-06-22 16:43:57 +00:00
// TypeError 8961: (90-109): Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable.
// TypeError 8961: (180-197): Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable.