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

Commit ceb595e

Browse files
adrpoOpenModelica-Hudson
authored andcommitted
[NF] do not set structural parameter variability for constants
if they have annotation(Evaluate=true) Belonging to [master]: - #2601
1 parent 11bce5a commit ceb595e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Compiler/NFFrontEnd/NFExpression.mo

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1179,7 +1179,10 @@ public
11791179

11801180
end match;
11811181

1182-
// (dexp, changed) := ExpressionSimplify.simplify(dexp);
1182+
//(dexp, changed) := ExpressionSimplify.simplify(dexp);
1183+
//if changed then
1184+
// (dexp, changed) := ExpressionSimplify.simplify(dexp);
1185+
//end if;
11831186
end toDAE;
11841187

11851188
function dimensionCount

Compiler/NFFrontEnd/NFTyping.mo

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -691,8 +691,9 @@ algorithm
691691
c := InstNode.component(node);
692692

693693
// @adrpo: if Evaluate=true make the parameter a structural parameter
694-
if Component.getEvaluateAnnotation(c) then
695-
c := Component.setVariability(Variability.STRUCTURAL_PARAMETER, c);
694+
// only make it a structural parameter if is not constant, duh!, 1071 regressions :)
695+
if Component.getEvaluateAnnotation(c) and (Component.variability(c) > Variability.STRUCTURAL_PARAMETER) then
696+
c := Component.setVariability(Variability.STRUCTURAL_PARAMETER, c);
696697
end if;
697698

698699
() := match c

0 commit comments

Comments
 (0)