Opened 3 years ago

Closed 3 years ago

Last modified 2 years ago

#5225 closed defect (fixed)

Annotations on replaceable components

Reported by: Jesper Mattsson Owned by: Jesper Mattsson
Priority: major Milestone: Pending
Component: Modelica/FrontEnd Version: trunk
Keywords: Cc:

Description (last modified by Jesper Mattsson)

For replaceable components, the grammar allows annotations in two places:

replaceable A a annotation(...) constrainedby B annotation(...);

The annotation() method always gives what is in the first position, but normally only the second position is used when a constraining clause is present, and in that case it should be used (as there is no semantic difference).

We need to consider what to do if both are present.

Example where the annotation is currently ignored:

model Test
    replaceable parameter Real a = 2 constrainedby Real annotation(Evaluate = true);
    parameter Real b = 2 * a;
end Test;

Change History (6)

comment:1 Changed 3 years ago by Jesper Mattsson

Description: modified (diff)

comment:2 Changed 3 years ago by Jesper Mattsson

Description: modified (diff)

comment:3 Changed 3 years ago by jsten

I suggest that we go with the concatenate the two, reason being that the specification doesn't differentiate between them (or so it seems).

comment:4 Changed 3 years ago by Zimon Kuhs

changeset:9897

Added a annotation provider based on a chained iterable, and changed annotations for short class declarations to use it. This in order to support the case where an annotation exists both for the declaration and a constrainedby clause.

comment:5 Changed 3 years ago by Zimon Kuhs

Resolution: fixed
Status: newclosed

comment:6 Changed 2 years ago by jsten

changeset:10071
Fixed bug where annotations were inaccessible for component declarations with constrainedby clauses. Similar issue were fixed for classes in r9897, but for some reasons it wasn't fixed for components.

Note: See TracTickets for help on using tickets.