Merge pull request #8140 from nventuro/patch-1

Fix error message suggestion for receive
This commit is contained in:
chriseth 2020-01-14 23:36:09 +01:00 committed by GitHub
commit 0149220e0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -680,7 +680,7 @@ ASTPointer<VariableDeclaration> Parser::parseVariableDeclaration(
fatalParserError( fatalParserError(
"Expected a state variable declaration. If you intended this as a fallback function " "Expected a state variable declaration. If you intended this as a fallback function "
"or a function to handle plain ether transactions, use the \"fallback\" keyword " "or a function to handle plain ether transactions, use the \"fallback\" keyword "
"or the \"ether\" keyword instead." "or the \"receive\" keyword instead."
); );
bool isIndexed = false; bool isIndexed = false;

View File

@ -2,4 +2,4 @@ contract C {
function() external {} function() external {}
} }
// ---- // ----
// ParserError: (37-38): Expected a state variable declaration. If you intended this as a fallback function or a function to handle plain ether transactions, use the "fallback" keyword or the "ether" keyword instead. // ParserError: (37-38): Expected a state variable declaration. If you intended this as a fallback function or a function to handle plain ether transactions, use the "fallback" keyword or the "receive" keyword instead.

View File

@ -2,4 +2,4 @@ contract C {
function() external payable {} function() external payable {}
} }
// ---- // ----
// ParserError: (45-46): Expected a state variable declaration. If you intended this as a fallback function or a function to handle plain ether transactions, use the "fallback" keyword or the "ether" keyword instead. // ParserError: (45-46): Expected a state variable declaration. If you intended this as a fallback function or a function to handle plain ether transactions, use the "fallback" keyword or the "receive" keyword instead.