Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit 38d78f5

Browse files
sjoelundOpenModelica-Hudson
authored andcommitted
Fix simplify for cat-expressions
The dimensions stored in the arrays were sometimes wrong. Belonging to [master]: - #2352
1 parent 65d57a5 commit 38d78f5

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Compiler/FrontEnd/Expression.mo

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3623,7 +3623,7 @@ protected
36233623
DAE.Type ty;
36243624
algorithm
36253625
ty := typeof(listHead(inElements));
3626-
outArray := DAE.ARRAY(ty, not Types.isArray(ty), inElements);
3626+
outArray := DAE.ARRAY(DAE.T_ARRAY(ty,{DAE.DIM_INTEGER(listLength(inElements))}), not Types.isArray(ty), inElements);
36273627
end makeArrayFromList;
36283628

36293629
public function makeScalarArray
@@ -4696,8 +4696,7 @@ algorithm
46964696
equation
46974697
i = dimensionSize(d);
46984698
true = i == listLength(inList);
4699-
then
4700-
DAE.ARRAY(DAE.T_ARRAY(inType,{DAE.DIM_INTEGER(i)}),false,inList);
4699+
then makeArrayFromList(inList);
47014700

47024701
case(_, {d}, _)
47034702
equation
@@ -4743,7 +4742,7 @@ algorithm
47434742
fail();
47444743
else
47454744
(explst, restexps) = List.split(inList,i);
4746-
arrexp = DAE.ARRAY(DAE.T_ARRAY(inType,{DAE.DIM_INTEGER(i)}),false,explst);
4745+
arrexp = makeArrayFromList(explst);
47474746
restarr = listToArray3(restexps,d,inType);
47484747
end if;
47494748
then

0 commit comments

Comments
 (0)