Constructor must be internal or public

This commit is contained in:
Alex Beregszaszi 2016-09-06 04:07:05 +01:00 committed by chriseth
parent e8cb4d2897
commit 7af8ecc27a

View File

@ -80,6 +80,8 @@ bool TypeChecker::visit(ContractDefinition const& _contract)
typeError(function->returnParameterList()->location(), "Non-empty \"returns\" directive for constructor.");
if (function->isDeclaredConst())
typeError(function->location(), "Constructor cannot be defined as constant.");
if (function->visibility() != FunctionDefinition::Visibility::Public && function->visibility() != FunctionDefinition::Visibility::Internal)
typeError(function->location(), "Constructor must be public or internal.");
}
FunctionDefinition const* fallbackFunction = nullptr;