Skip to content

Parameters without explicit start attribute modifiers should cause compilation to fail #10386

@casella

Description

@casella

Description

MLS 3.5 Section 8.6 states:

If a parameter has a modifier for the start attribute, does not have fixed = false, and neither has a binding equation nor is part of a record having a binding equation, the modifier for the start attribute can be used to add a parameter binding equation assigning the parameter to that start value. In this case a diagnostic message is recommended in a simulation model.

So, according to MSL 3.5, this model should be rejected:

model M
  parameter Real p;
end M;

Unfortunately, OMC accepts it with a warning.

MLS 3.6 removed the default start attribute 0.0 from the predefined Real definition and accordingly changed the definition in 8.6:

If a parameter has a value for the start-attribute, does not have fixed = false, and neither has a binding equation nor is part of a record having a binding equation, the value for the start-attribute can be used to add a parameter binding equation assigning the parameter to that start value. In this case a diagnostic message is recommended in a simulation model.

but the net effect is the same.

Expected behaviour

Parameters with fixed = true and no binding equations or explicit start attribute modifiers should cause a model to be rejected.

Metadata

Metadata

Assignees

Labels

COMP/OMC/BackendIssue and pull request related to the backend

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions