From 147e77b61fd202cbfd593270cc2639477ea7c61e Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 16 Dec 2014 23:45:24 +0100 Subject: Fix: Resolve function types of all contracts before checking types inside functions. --- CompilerStack.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'CompilerStack.cpp') 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 const& node: source->ast->getNodes()) + if (ContractDefinition* contract = dynamic_cast(node.get())) + { + m_globalContext->setCurrentContract(*contract); + resolver.updateDeclaration(*m_globalContext->getCurrentThis()); + resolver.checkTypeRequirements(*contract); + m_contracts[contract->getName()].contract = contract; + } m_parseSuccessful = true; } -- cgit v1.2.3