mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix shadowing for imports with aliases.
This commit is contained in:
parent
decfa0eed0
commit
4272d16f30
@ -457,9 +457,10 @@ bool DeclarationRegistrationHelper::registerDeclaration(
|
||||
if (!_errorLocation)
|
||||
_errorLocation = &_declaration.location();
|
||||
|
||||
string name = _name ? *_name : _declaration.name();
|
||||
Declaration const* shadowedDeclaration = nullptr;
|
||||
if (_warnOnShadow && !_declaration.name().empty() && _container.enclosingContainer())
|
||||
for (auto const* decl: _container.enclosingContainer()->resolveName(_declaration.name(), true))
|
||||
if (_warnOnShadow && !name.empty() && _container.enclosingContainer())
|
||||
for (auto const* decl: _container.enclosingContainer()->resolveName(name, true))
|
||||
shadowedDeclaration = decl;
|
||||
|
||||
if (!_container.registerDeclaration(_declaration, _name, !_declaration.isVisibleInContract()))
|
||||
|
Loading…
Reference in New Issue
Block a user