Skip to content

Commit

Permalink
- Fix for getNthComponent (partialInstClass wouldn't work on certain …
Browse files Browse the repository at this point in the history
…scopes that extend with modifications).

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@5316 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Apr 15, 2010
1 parent bbd366a commit 5b76eaa
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Compiler/InstExtends.mo
Expand Up @@ -112,6 +112,7 @@ algorithm
InstanceHierarchy ih;
HashTableStringToPath.HashTable ht;
Integer tmp;
SCode.Variability var;
/* instantiate a base class */
case (cache,env,ih,mod,(SCode.EXTENDS(baseClassPath = tp,modifications = emod) :: rest),ci_state,className,impl,isPartialInst)
equation
Expand Down Expand Up @@ -193,11 +194,19 @@ algorithm
then
fail();

/* Filter out non-constants if partial inst */
case (cache,env,ih,mod,SCode.COMPONENT(component = s, attributes = SCode.ATTR(variability = var)) :: rest,ci_state,className,impl,true) /* Components that are not EXTENDS */
equation
false = SCode.isConstant(var);
(cache,env_1,ih,mods,compelts2,eq2,initeq2,alg2,ialg2) =
instExtendsList(cache,env,ih, mod, rest, ci_state, className, impl, true);
then
(cache,env_1,ih,mods,compelts2,eq2,initeq2,alg2,ialg2);

/* instantiate elements that are not extends */
case (cache,env,ih,mod,(elt :: rest),ci_state,className,impl,isPartialInst) /* Components that are not EXTENDS */
equation
false = SCode.isElementExtends(elt) "verify that it is not an extends element";
// Debug.traceln("Not extends: " +& SCode.printElementStr(elt));
(cache,env_1,ih,mods,compelts2,eq2,initeq2,alg2,ialg2) =
instExtendsList(cache,env,ih, mod, rest, ci_state, className, impl, isPartialInst);
then
Expand Down

0 comments on commit 5b76eaa

Please sign in to comment.