mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Nicer error message for private payable functions
This commit is contained in:
parent
526e7b878b
commit
eab12ecf77
@ -337,7 +337,7 @@ bool TypeChecker::visit(FunctionDefinition const& _function)
|
||||
if (_function.libraryFunction())
|
||||
m_errorReporter.typeError(7708_error, _function.location(), "Library functions cannot be payable.");
|
||||
if (_function.isOrdinary() && !_function.isPartOfExternalInterface())
|
||||
m_errorReporter.typeError(5587_error, _function.location(), "Internal functions cannot be payable.");
|
||||
m_errorReporter.typeError(5587_error, _function.location(), "\"internal\" and \"private\" functions cannot be payable.");
|
||||
}
|
||||
auto checkArgumentAndReturnParameter = [&](VariableDeclaration const& var) {
|
||||
if (type(var)->category() == Type::Category::Mapping)
|
||||
|
@ -2,4 +2,4 @@ contract test {
|
||||
function f() payable internal {}
|
||||
}
|
||||
// ----
|
||||
// TypeError 5587: (20-52): Internal functions cannot be payable.
|
||||
// TypeError 5587: (20-52): "internal" and "private" functions cannot be payable.
|
||||
|
@ -2,4 +2,4 @@ contract test {
|
||||
function f() payable private {}
|
||||
}
|
||||
// ----
|
||||
// TypeError 5587: (20-51): Internal functions cannot be payable.
|
||||
// TypeError 5587: (20-51): "internal" and "private" functions cannot be payable.
|
||||
|
Loading…
Reference in New Issue
Block a user