Opened 6 years ago

Closed 6 years ago

#3599 closed defect (fixed)

Redeclaring primitives

Reported by: Jesper Mattsson Owned by: Jesper Mattsson
Priority: major Milestone: 1.14.x
Component: Modelica/FrontEnd Version: trunk
Keywords: #2593. #2595. Cc:

Description (last modified by Jesper Mattsson)

The subtype check for primitives checks if they have the same name, but they should instead check if they have the same underlying primitive type.

Example (should be allowed, but gives error):

model Test
    model A
        replaceable Real x;
    end A;
    
    type B = Real(unit="V");
    
    A a(redeclare B x);
end Test;

This is needed for #2593 and #2595.

Change History (3)

comment:1 Changed 6 years ago by Jesper Mattsson

Description: modified (diff)
Keywords: #2593. added

comment:2 Changed 6 years ago by Jesper Mattsson

Description: modified (diff)
Keywords: #2595. added

comment:3 Changed 6 years ago by Jesper Mattsson

Resolution: fixed
Status: newclosed

changeset:6218

Fixed broken subtyping of primitives.

Note: See TracTickets for help on using tickets.