Skip to content

Commit

Permalink
- PartialFn13 now works with if expressions again
Browse files Browse the repository at this point in the history
- Fixed some type conversions
- Added function unboxExpType to Exp



git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@4616 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Stefan Brus committed Dec 2, 2009
1 parent 22527c8 commit ef57c6c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
16 changes: 16 additions & 0 deletions Compiler/Exp.mo
Expand Up @@ -3535,6 +3535,22 @@ algorithm
end matchcontinue;
end checkIfOther;

// stefan
public function unboxExpType
"function: unboxExpType
takes a type, and if it is boxed, unbox it
otherwise return the given type"
input Type inType;
output Type outType;
algorithm
outType := matchcontinue(inType)
local
Type ty;
case(DAE.ET_BOXED(ty)) then ty;
case(ty) then ty;
end matchcontinue;
end unboxExpType;

public function makeDiff
"Takes two expressions and create
the difference between them"
Expand Down
10 changes: 8 additions & 2 deletions Compiler/PartFn.mo
Expand Up @@ -1609,7 +1609,7 @@ algorithm
DAE.Exp e;
Absyn.Path p,orig_p,new_p,current;
list<DAE.Element> inputs,dae,tmp;
DAE.ExpType ty;
DAE.ExpType ty,ty_1;
Boolean tup,bui,inl;
list<DAE.Exp> args,args2,args_1;
list<DAE.ComponentRef> crefs;
Expand Down Expand Up @@ -1644,8 +1644,9 @@ algorithm
crefs = Util.listMap(inputs,DAEUtil.varCref);
args2 = Util.listMap(crefs,Exp.crefExp);
args_1 = listAppend(args,args2);
ty_1 = Exp.unboxExpType(ty);
then
((DAE.CALL(p,args_1,tup,false,ty,inl),(p,inputs,dae,current)));
((DAE.CALL(p,args_1,tup,false,ty_1,inl),(p,inputs,dae,current)));
case((e,(p,inputs,dae,current))) then ((e,(p,inputs,dae,current)));
end matchcontinue;
end fixCall;
Expand Down Expand Up @@ -1695,6 +1696,11 @@ algorithm
true = Exp.typeBuiltin(et);
then
true;
case({DAE.CALL(ty = et)})
equation
true = Exp.typeBuiltin(et);
then
true;
case(_) then false;
end matchcontinue;
end isSimpleArg;
Expand Down

0 comments on commit ef57c6c

Please sign in to comment.