solidity/test/libsolidity/syntaxTests/receiveEther/default_visibility.sol
2022-04-01 23:41:18 -05:00

9 lines
440 B
Solidity

contract C {
// Check that visibility is also enforced for the receive ether function.
receive() {}
}
// ----
// SyntaxError 4937: (95-107='receive() {}'): No visibility specified. Did you intend to add "external"?
// DeclarationError 7793: (95-107='receive() {}'): Receive ether function must be payable, but is "nonpayable".
// DeclarationError 4095: (95-107='receive() {}'): Receive ether function must be defined as "external".