aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2016-09-06 11:07:05 +0800
committerchriseth <c@ethdev.com>2016-09-06 23:53:13 +0800
commit7af8ecc27ae1643d9f4c5a5ba1c1168efc76c1c6 (patch)
tree20b0608925ccd209f32b91911c8344aab3fb27b0 /libsolidity
parente8cb4d28970befb4c3e5052078e1b13812a44256 (diff)
downloaddexon-solidity-7af8ecc27ae1643d9f4c5a5ba1c1168efc76c1c6.tar.gz
dexon-solidity-7af8ecc27ae1643d9f4c5a5ba1c1168efc76c1c6.tar.zst
dexon-solidity-7af8ecc27ae1643d9f4c5a5ba1c1168efc76c1c6.zip
Constructor must be internal or public
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/analysis/TypeChecker.cpp2
1 files changed, 2 insertions, 0 deletions
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;