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

Commit 59e722e

Browse files
sjoelundOpenModelica-Hudson
authored andcommitted
Evaluate parameters with non-literal bindings
Previously, constant non-literal bindings such as `p=f(0)` were ignored. This is because Expression.isConst was used while it should have used isConstValue. Belonging to [master]: - #2117
1 parent 587cac2 commit 59e722e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Compiler/BackEnd/BackendVariable.mo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ algorithm
344344
DAE.Exp e;
345345

346346
case (BackendDAE.VAR(bindExp=SOME(e)))
347-
then not Expression.isConst(e);
347+
then not Expression.isConstValue(e) /* Do not use isConst here; we need to evaluate non-literals at runtime */;
348348

349349
else not varHasConstantStartExp(v);
350350
end match;
@@ -359,7 +359,7 @@ protected
359359
algorithm
360360
try
361361
e := varStartValueFail(v);
362-
out := Expression.isConst(e);
362+
out := Expression.isConstValue(e) /* Do not use isConst here; we need to evaluate non-literals at runtime */;
363363
else
364364
out := true;
365365
end try;

0 commit comments

Comments
 (0)