fixed the test

This commit is contained in:
Liana Husikyan 2015-05-07 18:12:58 +02:00
parent 495d827ece
commit e7568b5f4d
2 changed files with 7 additions and 5 deletions

View File

@ -130,12 +130,14 @@ vector<Declaration const*> NameAndTypeResolver::getNameFromCurrentScope(ASTStrin
return m_currentScope->resolveName(_name, _recursive);
}
vector<Declaration const*> NameAndTypeResolver::cleanupedDeclarations(Identifier const& _identifier)
vector<Declaration const*> NameAndTypeResolver::cleanupedDeclarations(
Identifier const& _identifier,
vector<Declaration const*> const& _declarations
)
{
vector<Declaration const*> uniqueFunctions;
auto declarations = m_currentScope->resolveName(_identifier.getName());
for (auto it = declarations.begin(); it != declarations.end(); ++it)
for (auto it = _declarations.begin(); it != _declarations.end(); ++it)
{
solAssert(*it, "");
// the declaration is functionDefinition while declarations > 1
@ -480,7 +482,7 @@ bool ReferencesResolver::visit(Identifier& _identifier)
else if (declarations.size() == 1)
_identifier.setReferencedDeclaration(*declarations.front(), m_currentContract);
else
_identifier.setOverloadedDeclarations(m_resolver.cleanupedDeclarations(_identifier));
_identifier.setOverloadedDeclarations(m_resolver.cleanupedDeclarations(_identifier, declarations));
return false;
}

View File

@ -62,7 +62,7 @@ public:
/// resolving phase.
std::vector<Declaration const*> getNameFromCurrentScope(ASTString const& _name, bool _recursive = true);
std::vector<Declaration const*> cleanupedDeclarations(Identifier const& _identifier);
std::vector<Declaration const*> cleanupedDeclarations(Identifier const& _identifier, std::vector<Declaration const*> const& _declarations);
private:
void reset();