Warn if modifiers are applied to functions without implementation.

This commit is contained in:
chriseth
2018-04-11 22:00:21 +02:00
parent d64e933327
commit 2ad1acaf72
5 changed files with 35 additions and 4 deletions
+7
View File
@@ -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;
}