Disallow functions without implementation to use modifiers. This was already the case in the experimental 0.5.0 mode.

This commit is contained in:
Christian Parpart
2018-07-23 17:29:08 +01:00
committed by Alex Beregszaszi
parent 0fcdafe2b5
commit 9f35f0b805
4 changed files with 6 additions and 11 deletions
+2 -8
View File
@@ -213,8 +213,6 @@ bool SyntaxChecker::visit(ContractDefinition const& _contract)
bool SyntaxChecker::visit(FunctionDefinition const& _function)
{
bool const v050 = m_sourceUnit->annotation().experimentalFeatures.count(ExperimentalFeature::V050);
if (_function.noVisibilitySpecified())
{
string suggestedVisibility = _function.isFallback() || m_isInterface ? "external" : "public";
@@ -225,12 +223,8 @@ bool SyntaxChecker::visit(FunctionDefinition const& _function)
}
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." );
}
m_errorReporter.syntaxError(_function.location(), "Functions without implementation cannot have modifiers.");
return true;
}