Opened 6 years ago

Closed 6 years ago

#5174 closed defect (fixed)

[Replaceable components] Wrong flattening of models with replaceble components

Reported by: igor.timofeyev@… Owned by: Lennart Ochel
Priority: high Milestone: 2.0.0
Component: New Instantiation Version:
Keywords: Replaceable extends duplicate declarations Cc:

Description

The following code doesn't work in OpenModelica, which sufficiently reduces the usage of replaceble components. Both examples give model A3 with two identical (duplicate) declarations of "Real A"

Exmple1:

  model A1
    replaceable Real A;
  end A1;

  model A2
    replaceable Real A;
  end A2;

  model A3
    extends A1;
    extends A2;
  end A3;

Example2:

 model A1
    Real A;
  end A1;

  model A2
    Real A;
  end A2;

  model A3
    extends A1(redeclare Real A);
    extends A2;
  end A3;

Change History (1)

comment:1 by Francesco Casella, 6 years ago

Component: BackendNew Instantiation
Milestone: 1.13.02.0.0
Resolution: fixed
Status: newclosed

These two models work correctly with the new front-end. In OMEdit, set Tools|Options|Simulation|OMC Command Line Options to -d=newInst. If you then flatten both A3 models you get

class abc.A3
  Real A;
end abc.A3;

This will become the standard behaviour from 2.0.0. We are no longer upgrading the old front-end.

Note: See TracTickets for help on using tickets.