Skip to content

Commit

Permalink
- fixes to inner outer prefixing when prefix is Prefix.NOPRE (top sco…
Browse files Browse the repository at this point in the history
…pe).

- testsuite/flattening/modelica/scoping/InnerEnumeration.mo to test the fix.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@17044 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Sep 3, 2013
1 parent 8fccb74 commit f0b263f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/InnerOuter.mo
Expand Up @@ -1598,7 +1598,7 @@ algorithm
// we have some outer references, search for our prefix + cref in them
case ({TOP_INSTANCE(_, _, outerPrefixes as _::_)}, _, _)
equation
(_,fullCref) = PrefixUtil.prefixCref(Env.emptyCache(),{},emptyInstHierarchy,inPrefix, inOuterComponentRef);
(_,fullCref) = PrefixUtil.prefixCref(Env.emptyCache(), {}, emptyInstHierarchy, inPrefix, inOuterComponentRef);

// this will fail if we don't find it so prefixing can happen in the calling function
(outerCrefPrefix, innerCrefPrefix) = searchForInnerPrefix(fullCref, outerPrefixes);
Expand Down
9 changes: 8 additions & 1 deletion Compiler/FrontEnd/PrefixUtil.mo
Expand Up @@ -663,7 +663,11 @@ algorithm
DAE.CallAttributes attr;

// no prefix, return the input expression
case (cache,_,_,e,Prefix.NOPRE()) then (cache,e);
case (cache,_,_,e,Prefix.NOPRE())
equation
false = System.getHasInnerOuterDefinitions();
then
(cache,e);

// handle literal constants
case (cache,_,_,(e as DAE.ICONST(integer = _)),_) then (cache,e);
Expand Down Expand Up @@ -863,6 +867,9 @@ algorithm
then (cache,DAE.META_OPTION(NONE()));
// ------------------------

// no prefix, return the input expression
case (cache,_,_,e,Prefix.NOPRE()) then (cache,e);

case (_,_,_,e,_)
equation
true = Flags.isSet(Flags.FAILTRACE);
Expand Down

0 comments on commit f0b263f

Please sign in to comment.