Skip to content
This repository has been archived by the owner on May 18, 2019. It is now read-only.

Commit

Permalink
[NF] Revert to first base class lookup fix.
Browse files Browse the repository at this point in the history
- Just checking that the scope is a class is probably the best way
  after all.

Belonging to [master]:
  - #2555
  • Loading branch information
perost authored and OpenModelica-Hudson committed Jul 3, 2018
1 parent e3f55e4 commit 412a023
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Compiler/NFFrontEnd/NFLookup.mo
Expand Up @@ -359,7 +359,7 @@ function lookupSimpleName
input InstNode scope;
output InstNode node;
protected
InstNode cur_scope = InstNode.classScope(scope);
InstNode cur_scope = scope;
algorithm
// Look for the name in each enclosing scope, until it's either found or we
// run out of scopes.
Expand All @@ -370,13 +370,13 @@ algorithm
else
// TODO: Handle encapsulated scopes.
// If the scope has the same name as we're looking for we can just return it.
if name == InstNode.name(cur_scope) then
if name == InstNode.name(cur_scope) and InstNode.isClass(cur_scope) then
node := cur_scope;
return;
else
// Otherwise, continue in the enclosing scope.
cur_scope := InstNode.parentScope(cur_scope);
end if;

// Otherwise, continue in the enclosing scope.
cur_scope := InstNode.parentScope(cur_scope);
end try;
end for;

Expand Down

0 comments on commit 412a023

Please sign in to comment.