diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 5ae0443ad..ce55de000 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(*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 3623046eb..bcfd33f2b 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 const& modifierInvocation = m_currentFunction->modifiers()[m_modifierDepth];