From 72fea3b0ddc882aecf45cc610d517be81b60a87c Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Sat, 11 Feb 2017 00:15:03 +0000 Subject: [PATCH] Check for import aliases --- libsolidity/analysis/StaticAnalyzer.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libsolidity/analysis/StaticAnalyzer.cpp b/libsolidity/analysis/StaticAnalyzer.cpp index c2dfb4e52e5c..c6c52bb97797 100644 --- a/libsolidity/analysis/StaticAnalyzer.cpp +++ b/libsolidity/analysis/StaticAnalyzer.cpp @@ -98,6 +98,13 @@ bool StaticAnalyzer::visit(EventDefinition const& _event) bool StaticAnalyzer::visit(ImportDirective const& _import) { checkShadowingBuiltin(_import); + for (auto const& alias: _import.symbolAliases()) + { + ASTString aliasName = *(alias.second.get()); + for (string const name: m_globals) + if (name == aliasName) + warning(_import.location(), "Shadowing builtin symbol \"" + name + "\"."); + } return true; }