From 670df8e874662901fe16b6c1995c5eeadf1283a1 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Fri, 25 Aug 2017 15:39:20 +0100 Subject: Attach natspec before type checking --- libsolidity/interface/CompilerStack.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index 5837c642..1f6fd12f 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -188,6 +188,9 @@ bool CompilerStack::analyze() if (!resolver.updateDeclaration(*m_globalContext->currentSuper())) return false; if (!resolver.resolveNamesAndTypes(*contract)) return false; + contract->setDevDocumentation(Natspec::devDocumentation(*contract)); + contract->setUserDocumentation(Natspec::userDocumentation(*contract)); + // Note that we now reference contracts by their fully qualified names, and // thus contracts can only conflict if declared in the same source file. This // already causes a double-declaration error elsewhere, so we do not report @@ -202,12 +205,7 @@ bool CompilerStack::analyze() if (ContractDefinition* contract = dynamic_cast(node.get())) { TypeChecker typeChecker(m_errorReporter); - if (typeChecker.checkTypeRequirements(*contract)) - { - contract->setDevDocumentation(Natspec::devDocumentation(*contract)); - contract->setUserDocumentation(Natspec::userDocumentation(*contract)); - } - else + if (!typeChecker.checkTypeRequirements(*contract)) noErrors = false; } -- cgit v1.2.3