mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Warn if modifiers are applied to functions without implementation.
This commit is contained in:
@@ -232,6 +232,13 @@ bool SyntaxChecker::visit(FunctionDefinition const& _function)
|
||||
"Use \"constructor(...) { ... }\" instead."
|
||||
);
|
||||
}
|
||||
if (!_function.isImplemented() && !_function.modifiers().empty())
|
||||
{
|
||||
if (v050)
|
||||
m_errorReporter.syntaxError(_function.location(), "Functions without implementation cannot have modifiers.");
|
||||
else
|
||||
m_errorReporter.warning( _function.location(), "Modifiers of functions without implementation are ignored." );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user