diff options
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 5 | ||||
-rw-r--r-- | libsolidity/codegen/ContractCompiler.cpp | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 5ae0443a..ce55de00 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -32,7 +32,7 @@ using namespace dev; using namespace dev::solidity; -bool TypeChecker::checkTypeRequirements(const ContractDefinition& _contract) +bool TypeChecker::checkTypeRequirements(ContractDefinition const& _contract) { try { @@ -174,6 +174,9 @@ void TypeChecker::checkContractAbstractFunctions(ContractDefinition const& _cont for (ContractDefinition const* contract: boost::adaptors::reverse(_contract.annotation().linearizedBaseContracts)) for (FunctionDefinition const* function: contract->definedFunctions()) { + // Take constructors out of overload hierarchy + if (function->isConstructor()) + continue; auto& overloads = functions[function->name()]; FunctionTypePointer funType = make_shared<FunctionType>(*function); auto it = find_if(overloads.begin(), overloads.end(), [&](FunTypeAndFlag const& _funAndFlag) diff --git a/libsolidity/codegen/ContractCompiler.cpp b/libsolidity/codegen/ContractCompiler.cpp index 3623046e..bcfd33f2 100644 --- a/libsolidity/codegen/ContractCompiler.cpp +++ b/libsolidity/codegen/ContractCompiler.cpp @@ -776,7 +776,10 @@ void ContractCompiler::appendModifierOrFunctionCode() { solAssert(m_currentFunction, ""); if (m_modifierDepth >= m_currentFunction->modifiers().size()) + { + solAssert(m_currentFunction->isImplemented(), ""); m_currentFunction->body().accept(*this); + } else { ASTPointer<ModifierInvocation> const& modifierInvocation = m_currentFunction->modifiers()[m_modifierDepth]; |