@@ -1129,7 +1129,7 @@ algorithm
11291129 tp1 = Expression . liftArrayLeft(tp1,DAE . DIM_INTEGER (dim));
11301130 e = DAE . ARRAY (tp1,sc,es);
11311131 e = Expression . makePureBuiltinCall("sum" ,{e},tp2);
1132- // print("Matrix sum: " +& boolString(sc) +& ExpressionDump.typeString (tp1) +& " " +& ExpressionDump.printExpStr(e) +& "\n");
1132+ // print("Matrix sum: " +& boolString(sc) +& Types.unparseType (tp1) +& " " +& ExpressionDump.printExpStr(e) +& "\n");
11331133 then e;
11341134 // Then try array concatenation
11351135 case DAE . CALL (path= Absyn . IDENT ("sum" ),expLst= {DAE . ARRAY (array= es,ty= tp1,scalar= false )},attr= DAE . CALL_ATTR (ty= tp2))
@@ -1143,7 +1143,7 @@ algorithm
11431143 tp1 = Expression . liftArrayLeft(tp1,DAE . DIM_INTEGER (dim));
11441144 e = DAE . ARRAY (tp1,sc,es);
11451145 e = Expression . makePureBuiltinCall("sum" ,{e},tp2);
1146- // print("Array sum: " +& boolString(sc) +& ExpressionDump.typeString (tp1) +& " " +& ExpressionDump.printExpStr(e) +& "\n");
1146+ // print("Array sum: " +& boolString(sc) +& Types.unparseType (tp1) +& " " +& ExpressionDump.printExpStr(e) +& "\n");
11471147 then e;
11481148 // Try to reduce the number of dimensions
11491149 case DAE . CALL (path= Absyn . IDENT ("sum" ),expLst= {DAE . ARRAY (array= {e},scalar= false )},attr= DAE . CALL_ATTR (ty= tp2))
@@ -5046,13 +5046,15 @@ algorithm
50465046 local
50475047 Values . Value val;
50485048 DAE . Exp arr_exp,foldExp;
5049- DAE . Type aty;
5049+ DAE . Type aty,ty2 ;
50505050 list< DAE . Exp > exps;
50515051
50525052 case (Absyn . IDENT ("array" ),_,_,_,_,_,_)
50535053 equation
5054- aty = Types . unliftArray(ty);
5055- then Expression . makeScalarArray(inExps, aty);
5054+ aty = Types . unliftArray(Types . expTypetoTypesType(ty));
5055+ ty2 = Types . liftArray(aty, DAE . DIM_INTEGER (listLength(inExps))); // The size can be unknown before the reduction...
5056+ exp = Expression . makeArray(inExps, ty2, not Types . isArray(aty,{}));
5057+ then exp;
50565058
50575059 case (_,_,_,_,_,{},SOME (val)) then ValuesUtil . valueExp(val);
50585060 case (_,_,_,_,_,{},NONE ()) then fail();
0 commit comments