Opened 15 years ago

Last modified 12 years ago

#1106 closed defect (invalid)

Array modifications in class inheritance are not instantiated

Reported by: AlexeyLebedev Owned by: AlexeyLebedev
Priority: high Milestone: 1.9.0
Component: Frontend Version:
Keywords: Cc: AlexeyLebedev

Description (last modified by sjoelund.se)

Consider the following example:

model Test 

  class C
    parameter Real r;
    parameter Real[1] ra;
  end C;
  
  C c(r=0.1, ra[1]=0.2); 
  
  class C1
    extends C(r=0.1, ra[1]=0.2);
  end C1;
  
  C1 c1;     
  
end Test; 

It is translated into the following:

fclass Test
parameter Real c.r = 0.1;
parameter Real c.ra[1] = 0.2;
parameter Real c1.r = 0.1;
parameter Real c1.ra[1];
end Test;

I.e., the modification ra[1]=0.2 is not instantiated for C1, though it is instantiated correctly for c. The modification r=0.1 is instatiated correctly both for C1 and c. It does not depend on whether r and ra are declared parameters or not.

Change History (2)

comment:1 Changed 12 years ago by perost

Array modifications are no longer supported by OMC since they were removed from the Modelica specification, so this issue no longer matters.

comment:2 Changed 12 years ago by sjoelund.se

  • Cc changed from AlexeyLebedev, to AlexeyLebedev
  • Component changed from Instantiation to Frontend
  • Description modified (diff)
  • Milestone set to 1.9.0
Note: See TracTickets for help on using tickets.