Skip to content

Commit

Permalink
- better handling of EnumToInteger hack.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@16392 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Jun 19, 2013
1 parent 9447e2d commit d133bbf
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Compiler/FrontEnd/Lookup.mo
Original file line number Diff line number Diff line change
Expand Up @@ -1505,6 +1505,16 @@ algorithm
Absyn.Path id, scope;
Absyn.Info info;

// handle EnumToInteger! search directly in the top env, no matter where the function is!
case (cache,env,id,info)
equation
name = Absyn.pathLastIdent(id);
true = stringEq("EnumToInteger", name);
(cache,env as {Env.FRAME(clsAndVars = ht,types = httypes)}) = Builtin.initialEnv(cache);
(cache,res) = lookupFunctionsInFrame(cache, ht, httypes, env, name, info);
then
(cache,res);

// uq paths are different!
case (cache,env,id,info)
equation
Expand Down

0 comments on commit d133bbf

Please sign in to comment.