diff options
author | Christian <c@ethdev.com> | 2014-12-17 06:45:24 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2014-12-17 06:49:02 +0800 |
commit | 147e77b61fd202cbfd593270cc2639477ea7c61e (patch) | |
tree | e45799327589cddf7af99b92cb906da9b7c497ce /CompilerStack.cpp | |
parent | 5b802b685e794832bf8834183bf6c9604e513bbf (diff) | |
download | dexon-solidity-147e77b61fd202cbfd593270cc2639477ea7c61e.tar.gz dexon-solidity-147e77b61fd202cbfd593270cc2639477ea7c61e.tar.zst dexon-solidity-147e77b61fd202cbfd593270cc2639477ea7c61e.zip |
Fix: Resolve function types of all contracts before checking types inside functions.
Diffstat (limited to 'CompilerStack.cpp')
-rw-r--r-- | CompilerStack.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/CompilerStack.cpp b/CompilerStack.cpp index 23f5fd68..1242c0ab 100644 --- a/CompilerStack.cpp +++ b/CompilerStack.cpp @@ -73,6 +73,15 @@ void CompilerStack::parse() resolver.resolveNamesAndTypes(*contract); m_contracts[contract->getName()].contract = contract; } + for (Source const* source: m_sourceOrder) + for (ASTPointer<ASTNode> const& node: source->ast->getNodes()) + if (ContractDefinition* contract = dynamic_cast<ContractDefinition*>(node.get())) + { + m_globalContext->setCurrentContract(*contract); + resolver.updateDeclaration(*m_globalContext->getCurrentThis()); + resolver.checkTypeRequirements(*contract); + m_contracts[contract->getName()].contract = contract; + } m_parseSuccessful = true; } |