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

Commit 2e84817

Browse files
perostOpenModelica-Hudson
authored andcommitted
[NF] Fix Ceval.evalComponentBinding with 'each'.
Belonging to [master]: - #2694
1 parent 7fd4fbc commit 2e84817

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Compiler/NFFrontEnd/NFCeval.mo

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ protected
296296
list<Subscript> subs;
297297
Variability var;
298298
Option<Expression> start_exp;
299+
Integer pcount;
299300
algorithm
300301
exp_origin := if Class.isFunction(InstNode.getClass(InstNode.parent(node)))
301302
then ExpOrigin.FUNCTION else ExpOrigin.CLASS;
@@ -350,7 +351,8 @@ algorithm
350351

351352
// Apply subscripts from the cref to the binding expression as needed.
352353
if evaluated then
353-
exp := subscriptEvaluatedBinding(exp, cref, Binding.parentCount(binding), evalSubscripts);
354+
pcount := if Binding.isEach(binding) then 1 else Binding.parentCount(binding);
355+
exp := subscriptEvaluatedBinding(exp, cref, pcount, evalSubscripts);
354356
end if;
355357
end evalComponentBinding;
356358

0 commit comments

Comments
 (0)