From 7af8ecc27ae1643d9f4c5a5ba1c1168efc76c1c6 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Tue, 6 Sep 2016 04:07:05 +0100 Subject: Constructor must be internal or public --- libsolidity/analysis/TypeChecker.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libsolidity/analysis') diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 41a5d39e..d9c54f75 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -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; -- cgit