Merge pull request #8578 from ethereum/interface-function-modifier-error

Added error for interface functions that have modifiers; test case
This commit is contained in:
chriseth
2020-04-02 18:05:32 +02:00
committed by GitHub
2 changed files with 9 additions and 1 deletions
+3 -1
View File
@@ -303,7 +303,9 @@ bool SyntaxChecker::visit(FunctionDefinition const& _function)
);
}
if (!_function.isImplemented() && !_function.modifiers().empty())
if (m_isInterface && !_function.modifiers().empty())
m_errorReporter.syntaxError(_function.location(), "Functions in interfaces cannot have modifiers.");
else if (!_function.isImplemented() && !_function.modifiers().empty())
m_errorReporter.syntaxError(_function.location(), "Functions without implementation cannot have modifiers.");
return true;