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 Feb 14, 2017
1 parent b69390d commit 9c39439
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 @@ -98,6 +98,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 9c39439

Please sign in to comment.