Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- Fixed a problem when a metarecord had the same name as the package it was defined in (did a useless lookupClass in the wrong environment)


git-svn-id: https://openmodelica.org/svn/OpenModelica/branches/sjoelund-functiontree@6378 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Oct 14, 2010
1 parent 86a33c6 commit e2adcdf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Compiler/Dump.mo
Expand Up @@ -551,6 +551,8 @@ algorithm
case Absyn.R_PREDEFINED_REAL() then "Real";
case Absyn.R_PREDEFINED_STRING() then "String";
case Absyn.R_PREDEFINED_BOOLEAN() then "Boolean";
case Absyn.R_METARECORD(_,_) then "metarecord";
case _ then "*unknown*";
end matchcontinue;
end unparseRestrictionStr;

Expand Down
7 changes: 4 additions & 3 deletions Compiler/Static.mo
Expand Up @@ -8734,7 +8734,7 @@ algorithm
false = Util.getStatefulBoolean(stopElab);
(cache,t as (DAE.T_METARECORD(index,vars),_),env_1) = Lookup.lookupType(cache, env, fn, false);
Util.setStatefulBoolean(stopElab,true);
(cache,c,env_1) = Lookup.lookupClass(cache, env_1, fn, false);
//(cache,c,env_1) = Lookup.lookupClass(cache, env, fn, false);
// (_, _, _, _, (DAE.T_COMPLEX(complexClassType = ClassInf.META_RECORD(_), complexVarLst = vars),_), _, _, _) = Inst.instClass(cache,env_1,DAE.NOMOD(),Prefix.NOPRE(), Connect.emptySet,c,{},false,Inst.INNER_CALL(), ConnectionGraph.EMPTY);
fieldNames = Util.listMap(vars, Types.getVarName);
tys = Util.listMap(vars, Types.getVarType);
Expand All @@ -8744,8 +8744,9 @@ algorithm
const = Util.listReduce(constlist, Types.constAnd);
tyconst = elabConsts(t, const);
prop = getProperties(t, tyconst);
(cache,newslots2) = fillDefaultSlots(cache,newslots, c, env, impl,pre,info);
args_2 = expListFromSlots(newslots2);
true = Util.listFold(newslots, slotAnd, true);
//(cache,newslots2) = fillDefaultSlots(cache,newslots, c, env, impl,pre,info);
args_2 = expListFromSlots(newslots);
(cache, fqPath) = Inst.makeFullyQualified(cache, env_1, fn);
then
(cache,DAE.METARECORDCALL(fqPath,args_2,fieldNames,index),prop,Util.SUCCESS());
Expand Down

0 comments on commit e2adcdf

Please sign in to comment.