Skip to content

Commit

Permalink
Check for import aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
axic committed May 3, 2017
1 parent 71c1fb8 commit 5d199cf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libsolidity/analysis/StaticAnalyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@ bool StaticAnalyzer::visit(EventDefinition const& _event)
bool StaticAnalyzer::visit(ImportDirective const& _import)
{
checkShadowingBuiltin(_import);
for (auto const& alias: _import.symbolAliases())
{
if (auto aliasName = alias.second.get())
for (string const name: m_globals)
if (name == *aliasName)
warning(_import.location(), "Shadowing builtin symbol \"" + name + "\".");
}
return true;
}

Expand Down

0 comments on commit 5d199cf

Please sign in to comment.