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

Commit 0fb948c

Browse files
perostOpenModelica-Hudson
authored andcommitted
[NF] Fix moving of parameter binding to equation.
- Set 'fixed' to false when moving a complex parameter binding to an initial equation, not true. Belonging to [master]: - #2528
1 parent 6fe40c2 commit 0fb948c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Compiler/NFFrontEnd/NFFlatten.mo

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -302,18 +302,18 @@ protected
302302
Equation eq;
303303
list<tuple<String, Binding>> ty_attrs;
304304
Variability var;
305-
Boolean is_fixed;
305+
Boolean unfix;
306306
algorithm
307307
Component.TYPED_COMPONENT(ty = ty, binding = binding, attributes = comp_attr,
308308
comment = cmt, info = info) := comp;
309309
var := comp_attr.variability;
310310

311311
if isSome(outerBinding) then
312312
SOME(binding) := outerBinding;
313-
is_fixed := Binding.isUnbound(binding) and var == Variability.PARAMETER;
313+
unfix := Binding.isUnbound(binding) and var == Variability.PARAMETER;
314314
else
315315
binding := flattenBinding(binding, prefix);
316-
is_fixed := false;
316+
unfix := false;
317317
end if;
318318

319319
// If the component is an array component with a binding and at least discrete variability,
@@ -331,9 +331,9 @@ algorithm
331331

332332
// Set fixed = true for parameters that are part of a record instance whose
333333
// binding couldn't be split and was moved to an initial equation.
334-
if is_fixed then
334+
if unfix then
335335
ty_attrs := List.removeOnTrue("fixed", isTypeAttributeNamed, ty_attrs);
336-
ty_attrs := ("fixed", Binding.FLAT_BINDING(Expression.BOOLEAN(true), Variability.CONSTANT)) :: ty_attrs;
336+
ty_attrs := ("fixed", Binding.FLAT_BINDING(Expression.BOOLEAN(false), Variability.CONSTANT)) :: ty_attrs;
337337
end if;
338338

339339
vars := Variable.VARIABLE(name, ty, binding, visibility, comp_attr, ty_attrs, cmt, info) :: vars;

0 commit comments

Comments
 (0)