Opened 8 years ago
Closed 3 years ago
#3833 closed defect (fixed)
Redeclaring package Medium = Medium in extends does not work
Reported by: | adrpo | Owned by: | adrpo |
---|---|---|---|
Priority: | high | Milestone: | 1.16.0 |
Component: | New Instantiation | Version: | |
Keywords: | Cc: |
Description
The model:
within MyClass; model Mypipe extends Modelica.Fluid.Pipes.DynamicPipe(redeclare package Medium = Medium); replaceable package Medium=Modelica.Media.Water.StandardWater; equation annotation(Icon(coordinateSystem(grid = {2, 8}))); end Mypipe;
goes into an infinite loop during instantiation.
Change History (4)
comment:1 Changed 8 years ago by adrpo
- Owner changed from somebody to adrpo
- Status changed from new to accepted
comment:2 Changed 4 years ago by Christoph Buchner <buchner@…>
comment:3 Changed 4 years ago by casella
I'm sorry but I don't understand why you write the Mypipe model this way.
DynamicPipe already contains the declaration of a Medium package. Mypipe extends from it, so it already has it, and this causes some kind of conflict if you re-add the declaration with the same name. I can't see the point of doing so. Can't you just write
model Mypipe extends Modelica.Fluid.Pipes.DynamicPipe( redeclare replaceable package Medium = Modelica.Media.Water.StandardWater); annotation(Icon(coordinateSystem(grid = {2, 8}))); end Mypipe;
comment:4 Changed 3 years ago by perost
- Component changed from Frontend to New Instantiation
- Milestone changed from Future to 1.16.0
- Resolution set to fixed
- Status changed from accepted to closed
Closing this as fixed since the model is wrong and the new frontend as mentioned gives an error for it.
Using 1.14.0-dev.beta1, I get two errors for this model (without the within MyClass;)
At least there's no infinite loop anymore.