This repository was archived by the owner on May 18, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -850,11 +850,14 @@ uniontype Call
850850 input Type ty;
851851 protected
852852 Call call;
853+ Type cast_ty;
853854 algorithm
854855 Expression . CALL (call = call) := callExp;
855856
856857 callExp := match call
857858 case TYPED_CALL () guard Function . isBuiltin(call. fn)
859+ algorithm
860+ cast_ty := Type . setArrayElementType(call. ty, ty);
858861 then
859862 match Absyn . pathFirstIdent(Function . name(call. fn))
860863 // For 'fill' we can type cast the first argument rather than the
@@ -863,6 +866,7 @@ uniontype Call
863866 algorithm
864867 call. arguments := Expression . typeCast(listHead(call. arguments), ty) ::
865868 listRest(call. arguments);
869+ call. ty := cast_ty;
866870 then
867871 Expression . CALL (call);
868872
@@ -871,10 +875,11 @@ uniontype Call
871875 case "diagonal"
872876 algorithm
873877 call. arguments := {Expression . typeCast(listHead(call. arguments), ty)};
878+ call. ty := cast_ty;
874879 then
875880 Expression . CALL (call);
876881
877- else Expression . CAST (Type . setArrayElementType(call . ty, ty) , callExp);
882+ else Expression . CAST (cast_ty , callExp);
878883 end match;
879884
880885 else Expression . CAST (Type . setArrayElementType(typeOf(call), ty), callExp);
You can’t perform that action at this time.
0 commit comments