solidity/test/libsolidity/syntaxTests/receiveEther/view_modifier.sol

7 lines
164 B
Solidity

contract C {
uint x;
receive() external view { x = 2; }
}
// ----
// DeclarationError 7793: (29-63): Receive ether function must be payable, but is "view".