ModelicaSpecification
ModelicaSpecification copied to clipboard
Too restrictive plug-compatibility when redeclaring with partial type
Reported by hansolsson on 15 Mar 2013 08:49 UTC Francesco discovered this for PumpMonitoringNPSH.
A simple model demonstrating the issue is (the code contains some redundant parts):
model TwoPhasePipe
import Modelica.Media.Interfaces.PartialTwoPhaseMedium;
extends Modelica.Fluid.Pipes.StaticPipe(
redeclare replaceable partial package
Medium = PartialTwoPhaseMedium
constrainedby PartialTwoPhaseMedium);
end TwoPhasePipe;
Looking at 6.4 plug compatibility we see that there are new package constants without value (smoothValue, onePhase...). They are not "default connectable", and therefore PartialTwoPhaseMedium is not "plug compatible" with PartialMedium, and thus the redeclaration is incorrect.
This seems like an unnecessary limitation since PartiaulTwoPhaseMedium is partial and will anyway be redeclared before being used.
However, it might be that more is needed than just removing this restriction for partial classes.
Migrated-From: https://trac.modelica.org/Modelica/ticket/1030
Modified by otter on 18 Jul 2013 12:25 UTC
Comment by hansolsson on 1 Mar 2017 10:13 UTC Still seems like good idea (removing restriction for partial) - but needs to be investigated.