Skip to content

Commit

Permalink
Silence unbound parameter error in relaxed context (#12292) (#12293)
Browse files Browse the repository at this point in the history
Fixes #12291
  • Loading branch information
perost committed Apr 22, 2024
1 parent 80e181f commit b595415
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 2 additions & 1 deletion OMCompiler/Compiler/NFFrontEnd/NFFlatten.mo
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,8 @@ algorithm
name := Prefix.prefix(pre);
v := Variable.VARIABLE(name, ty, binding, visibility, comp_attr, ty_attrs, children, cmt, info, NFBackendExtension.DUMMY_BACKEND_INFO);

if var < Variability.DISCRETE and not unfix and not Type.isComplex(Type.arrayElementType(ty)) then
if not settings.relaxedErrorChecking and var < Variability.DISCRETE and
not unfix and not Type.isComplex(Type.arrayElementType(ty)) then
// Check that the component has a binding if it's required to have one.
verifyBinding(v, var, binding, settings);
end if;
Expand Down
4 changes: 1 addition & 3 deletions testsuite/flattening/modelica/scodeinst/OCGTests.mos
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,7 @@ checkModel(PowerSystems.Examples.AC3ph.Inverters.Rectifier); getErrorString();
// "Check of Transformer.SC2 completed successfully.
// Class Transformer.SC2 has 393 equation(s) and 393 variable(s).
// 183 of these are trivial equation(s)."
// "[flattening/modelica/scodeinst/Transformer.mo:42:5-42:94:writable] Warning: Parameter singlePhaseTransformerQS1.TRef has no value, and is fixed during initialization (fixed=true), using available start value (start=288.15) as default value.
// [flattening/modelica/scodeinst/Transformer.mo:427:13-427:88:writable] Warning: Parameter voltageSource1.phi has no value, and is fixed during initialization (fixed=true), using available start value (start=0.0) as default value.
// "
// ""
// true
// ""
// "Check of PowerSystems.Examples.AC3ph.Inverters.Rectifier completed successfully.
Expand Down

0 comments on commit b595415

Please sign in to comment.