modelica / ModelicaSpecification

Specification of the Modelica Language
https://specification.modelica.org
Creative Commons Attribution Share Alike 4.0 International
102 stars 41 forks source link

Too restrictive plug-compatibility when redeclaring with partial type #1030

Open modelica-trac-importer opened 6 years ago

modelica-trac-importer commented 6 years ago

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

modelica-trac-importer commented 6 years ago

Modified by otter on 18 Jul 2013 12:25 UTC

modelica-trac-importer commented 6 years ago

Comment by hansolsson on 1 Mar 2017 10:13 UTC Still seems like good idea (removing restriction for partial) - but needs to be investigated.