virtual modifiers (in Abstract contracts) allow empty bodies

This commit is contained in:
hrkrshnn
2020-04-23 17:26:59 +05:30
parent 0c5aa36e46
commit e2e32d372f
18 changed files with 87 additions and 67 deletions
+6
View File
@@ -289,6 +289,12 @@ void TypeChecker::endVisit(UsingForDirective const& _usingFor)
m_errorReporter.fatalTypeError(_usingFor.libraryName().location(), "Library name expected.");
}
void TypeChecker::endVisit(ModifierDefinition const& _modifier)
{
if (!_modifier.isImplemented() && !_modifier.virtualSemantics())
m_errorReporter.typeError(_modifier.location(), "Modifiers without implementation must be marked virtual.");
}
bool TypeChecker::visit(FunctionDefinition const& _function)
{
bool isLibraryFunction = _function.inContractKind() == ContractKind::Library;