From f300bdb020ca55b05f1725dc2157fb636c1e4801 Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 6 Mar 2017 14:12:20 +0100 Subject: Move public constructor property into AST itself. --- libsolidity/analysis/TypeChecker.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'libsolidity/analysis') diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index ff55ef1f..a9a2c82f 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -77,8 +77,6 @@ bool TypeChecker::visit(ContractDefinition const& _contract) FunctionDefinition const* function = _contract.constructor(); if (function) { - if (!function->isPublic()) - _contract.annotation().hasPublicConstructor = false; if (!function->returnParameters().empty()) typeError(function->returnParameterList()->location(), "Non-empty \"returns\" directive for constructor."); if (function->isDeclaredConst()) @@ -1290,7 +1288,7 @@ void TypeChecker::endVisit(NewExpression const& _newExpression) fatalTypeError(_newExpression.location(), "Identifier is not a contract."); if (!contract->annotation().isFullyImplemented) typeError(_newExpression.location(), "Trying to create an instance of an abstract contract."); - if (!contract->annotation().hasPublicConstructor) + if (!contract->constructorIsPublic()) typeError(_newExpression.location(), "Contract with internal constructor cannot be created directly."); solAssert(!!m_scope, ""); -- cgit