diff options
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/CompilerStack.cpp | 9 | ||||
-rw-r--r-- | libsolidity/TypeChecker.cpp | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/libsolidity/CompilerStack.cpp b/libsolidity/CompilerStack.cpp index e6b87264..6ee19d58 100644 --- a/libsolidity/CompilerStack.cpp +++ b/libsolidity/CompilerStack.cpp @@ -122,6 +122,7 @@ bool CompilerStack::parse() } InterfaceHandler interfaceHandler; + bool typesFine = true; for (Source const* source: m_sourceOrder) for (ASTPointer<ASTNode> const& node: source->ast->nodes()) if (ContractDefinition* contract = dynamic_cast<ContractDefinition*>(node.get())) @@ -129,14 +130,14 @@ bool CompilerStack::parse() m_globalContext->setCurrentContract(*contract); resolver.updateDeclaration(*m_globalContext->currentThis()); TypeChecker typeChecker; - bool typesFine = typeChecker.checkTypeRequirements(*contract); - if (!typesFine) - m_errors += typeChecker.errors(); + if (!typeChecker.checkTypeRequirements(*contract)) + typesFine = false; + m_errors += typeChecker.errors(); contract->setDevDocumentation(interfaceHandler.devDocumentation(*contract)); contract->setUserDocumentation(interfaceHandler.userDocumentation(*contract)); m_contracts[contract->name()].contract = contract; } - m_parseSuccessful = m_errors.empty(); + m_parseSuccessful = typesFine; return m_parseSuccessful; } diff --git a/libsolidity/TypeChecker.cpp b/libsolidity/TypeChecker.cpp index ec60373c..48a8a536 100644 --- a/libsolidity/TypeChecker.cpp +++ b/libsolidity/TypeChecker.cpp @@ -43,7 +43,7 @@ bool TypeChecker::checkTypeRequirements(const ContractDefinition& _contract) if (m_errors.empty()) throw; // Something is weird here, rather throw again. } - bool success = m_errors.empty(); + bool success = true; for (auto const& it: m_errors) if (!dynamic_cast<Warning const*>(it.get())) { |