aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/interface
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-08-25 22:39:20 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-08-25 22:39:20 +0800
commit670df8e874662901fe16b6c1995c5eeadf1283a1 (patch)
tree80aa3f6e5807bbf7649a10e7dca3707e8a7afb5e /libsolidity/interface
parentd60d4b3031001a188b2449c97e2d617d98c77f0e (diff)
downloaddexon-solidity-670df8e874662901fe16b6c1995c5eeadf1283a1.tar
dexon-solidity-670df8e874662901fe16b6c1995c5eeadf1283a1.tar.gz
dexon-solidity-670df8e874662901fe16b6c1995c5eeadf1283a1.tar.bz2
dexon-solidity-670df8e874662901fe16b6c1995c5eeadf1283a1.tar.lz
dexon-solidity-670df8e874662901fe16b6c1995c5eeadf1283a1.tar.xz
dexon-solidity-670df8e874662901fe16b6c1995c5eeadf1283a1.tar.zst
dexon-solidity-670df8e874662901fe16b6c1995c5eeadf1283a1.zip
Attach natspec before type checking
Diffstat (limited to 'libsolidity/interface')
-rw-r--r--libsolidity/interface/CompilerStack.cpp10
1 files 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<ContractDefinition*>(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;
}