Issue warning for using public visibility for interface functions

This commit is contained in:
Alex Beregszaszi
2018-02-01 10:28:00 +00:00
parent cc1c461fc0
commit b545987ec7
4 changed files with 12 additions and 3 deletions
+2
View File
@@ -604,6 +604,8 @@ bool TypeChecker::visit(FunctionDefinition const& _function)
{
if (_function.visibility() < FunctionDefinition::Visibility::Public)
m_errorReporter.typeError(_function.location(), "Functions in interfaces cannot be internal or private.");
else if (_function.visibility() != FunctionDefinition::Visibility::External)
m_errorReporter.warning(_function.location(), "Functions in interfaces should be declared external.");
}
if (_function.isConstructor())
m_errorReporter.typeError(_function.location(), "Constructor cannot be defined in interfaces.");