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

Commit 223798a

Browse files
perostOpenModelica-Hudson
authored andcommitted
[NF] Evaluate parameter subscripts.
- Mark parameter subscripts as structural so that they're evaluated. This should ideally not be necessary, but the backend relies on it since the old frontend does it. Belonging to [master]: - #2771
1 parent 98896ae commit 223798a

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

Compiler/NFFrontEnd/NFInst.mo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2914,7 +2914,7 @@ algorithm
29142914
case Class.INSTANCED_BUILTIN(elements = cls_tree as ClassTree.FLAT_TREE())
29152915
algorithm
29162916
for c in cls_tree.components loop
2917-
updateImplicitVariabilityComp(c, evalAllParams);
2917+
updateImplicitVariabilityComp(c, evalAllParams);
29182918
end for;
29192919
then
29202920
();
@@ -3236,7 +3236,7 @@ end markStructuralParamsSubs;
32363236

32373237
function markStructuralParamsSub
32383238
input Subscript sub;
3239-
input output Integer dummy;
3239+
input output Integer dummy = 0;
32403240
algorithm
32413241
() := match sub
32423242
case Subscript.UNTYPED() algorithm markStructuralParamsExp(sub.exp); then ();

Compiler/NFFrontEnd/NFTyping.mo

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,6 +1447,13 @@ algorithm
14471447
typedSubs := sub :: typedSubs;
14481448
variability := Prefixes.variabilityMax(variability, var);
14491449
i := i + 1;
1450+
1451+
// Mark parameter subscripts as structural so that they're evaluated.
1452+
// TODO: Ideally this shouldn't be needed, but the old frontend does it and
1453+
// the backend relies on it.
1454+
if var == Variability.PARAMETER then
1455+
Inst.markStructuralParamsSub(sub);
1456+
end if;
14501457
end for;
14511458

14521459
typedSubs := listReverseInPlace(typedSubs);

0 commit comments

Comments
 (0)