aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-08-05 03:38:45 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-08-05 03:38:45 +0800
commitbb0eb57c2f2eadb4cc4a88cd347b70fec7813887 (patch)
tree6dabbedb630a0bfcd9022e233a5f083955a5bef0 /libsolidity/analysis
parenta372941a442fe1029d212ebf7b097bdea7534fad (diff)
downloaddexon-solidity-bb0eb57c2f2eadb4cc4a88cd347b70fec7813887.tar.gz
dexon-solidity-bb0eb57c2f2eadb4cc4a88cd347b70fec7813887.tar.zst
dexon-solidity-bb0eb57c2f2eadb4cc4a88cd347b70fec7813887.zip
Constructors must be implemented if declared.
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r--libsolidity/analysis/TypeChecker.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp
index ce4baa3f..a9f5b931 100644
--- a/libsolidity/analysis/TypeChecker.cpp
+++ b/libsolidity/analysis/TypeChecker.cpp
@@ -192,13 +192,7 @@ void TypeChecker::checkContractAbstractFunctions(ContractDefinition const& _cont
{
// Take constructors out of overload hierarchy
if (function->isConstructor())
- {
- if (!function->isImplemented())
- // Base contract's constructor is not fully implemented, no way to get
- // out of this.
- _contract.annotation().unimplementedFunctions.push_back(function);
continue;
- }
auto& overloads = functions[function->name()];
FunctionTypePointer funType = make_shared<FunctionType>(*function);
auto it = find_if(overloads.begin(), overloads.end(), [&](FunTypeAndFlag const& _funAndFlag)
@@ -522,6 +516,8 @@ bool TypeChecker::visit(FunctionDefinition const& _function)
}
if (_function.isImplemented())
_function.body().accept(*this);
+ else if (_function.isConstructor())
+ m_errorReporter.typeError(_function.location(), "Constructor must be implemented if declared.");
return false;
}