mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Allow aliases during import.
This commit is contained in:
1 parent
aa645d1192
commit
f20a604c5a
4 files changed
+81
-16
No files matched your search
@@ -49,6 +49,8 @@ Declaration const* DeclarationContainer::conflictingDeclaration(
|
||||
if (!dynamic_cast<FunctionDefinition const*>(declaration))
|
||||
return declaration;
|
||||
}
|
||||
else if (declarations.size() == 1 && declarations.front() == &_declaration)
|
||||
return nullptr;
|
||||
else if (!declarations.empty())
|
||||
return declarations.front();
|
||||
|
||||
@@ -73,13 +75,12 @@ bool DeclarationContainer::registerDeclaration(
|
||||
m_declarations.erase(*_name);
|
||||
m_invisibleDeclarations.erase(*_name);
|
||||
}
|
||||
else if (conflictingDeclaration(_declaration))
|
||||
else if (conflictingDeclaration(_declaration, _name))
|
||||
return false;
|
||||
|
||||
if (_invisible)
|
||||
m_invisibleDeclarations[*_name].push_back(&_declaration);
|
||||
else
|
||||
m_declarations[*_name].push_back(&_declaration);
|
||||
vector<Declaration const*>& decls = _invisible ? m_invisibleDeclarations[*_name] : m_declarations[*_name];
|
||||
if (!contains(decls, &_declaration))
|
||||
decls.push_back(&_declaration);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user