diff --git a/symbol_search.cc b/symbol_search.cc index 2b6cc707f..b7e3df15b 100644 --- a/symbol_search.cc +++ b/symbol_search.cc @@ -202,11 +202,6 @@ bool symbol_search(const LineInfo*li, Design*des, NetScope*scope, } } - if (NetScope*import_scope = scope->find_import(des, path_tail.name)) { - scope = import_scope; - continue; - } - // Could not find an object. Maybe this is a child scope name? If // so, evaluate the path components to find the exact scope this // refers to. This item might be: @@ -234,6 +229,12 @@ bool symbol_search(const LineInfo*li, Design*des, NetScope*scope, if (prefix_scope) break; + // Imports are not visible through hierachical names + if (NetScope*import_scope = scope->find_import(des, path_tail.name)) { + scope = import_scope; + continue; + } + // Special case: We can match the module name of a parent // module. That means if the current scope is a module of type // "mod", then "mod" matches the current scope. This is fairly