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

Commit 15730cb

Browse files
sjoelundOpenModelica-Hudson
authored andcommitted
Return correct variability for reductions
If either the expression or the iterator is parameter, the entire expression has that variability (or lower). This fixes ticket:4550 Belonging to [master]: - #1870 - OpenModelica/OpenModelica-testsuite#727
1 parent b610cb9 commit 15730cb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Compiler/FrontEnd/Static.mo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,7 +1350,7 @@ algorithm
13501350
inDoVect, inPrefix, inInfo);
13511351

13521352
// Figure out the type of the reduction.
1353-
c := exp_const; // Types.constAnd(exp_const, iter_const);
1353+
c := Types.constAnd(exp_const, iter_const);
13541354
fn := match inReductionFn
13551355
case Absyn.CREF_IDENT("$array",{}) then Absyn.IDENT("array");
13561356
else Absyn.crefToPath(inReductionFn);
@@ -1463,7 +1463,7 @@ algorithm
14631463
dim := DAE.DIM_UNKNOWN();
14641464
end if;
14651465

1466-
outConst := Types.constAnd(guard_const, iter_const);
1466+
outConst := Types.constAnd(outConst, Types.constAnd(guard_const, iter_const));
14671467
outIterators := DAE.REDUCTIONITER(iter_name, iter_exp, guard_exp, iter_ty) :: outIterators;
14681468
outDims := dim :: outDims;
14691469
end for;

0 commit comments

Comments
 (0)