﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
2959	Use of partial, non-redeclared classes is not reported by the front-end	Francesco Casella	Adrian Pop	"Consider the following model, obtained by dragging components from the Fluid library in OMEdit:

{{{
model Test
  Modelica.Fluid.Vessels.ClosedVolume volume
   (V = 1, use_portsData = false);
  inner Modelica.Fluid.System system;
end Test;
}}}

When checking the model, OMC reports:
{{{
Warning: Forcing full instantiation of partial class 
  BaseProperties$volume$medium during checkModel.
Error: Internal error - InstUtil.moveBindings:
  Mismatched number of equations and variables.
Error: Error occurred while flattening model Test
}}}

When trying to simulate it, OMC reports:
{{{
Error occurred while flattening model Test
Illegal to instantiate partial class BaseProperties$volume$medium
}}}

The problem with this model is that the replaceble package Medium of the component volume has not been redeclared and defaults to a partial class. The cure is of course to redeclare Medium (in fact, this is not yet possible with OMEdit but that's another story, see #2079).

The trouble is that the error messages refer to the ''consequences'' of this problem instead, and are totally obscure to non-experts of the Media/Fluid library, who are clueless about what the heck {{{BaseProperties$volume$medium}}} is. Even more important, they are also clueless about how to fix the problem, that is, redeclare the Medium package. On this issue, see, e.g., ticket:2079#comment:4 and ticket:2079#comment:7. 

Would it be possible to get an error message along these lines (please use more appropriate terms if necessary):
{{{
Error: component volume contains the definition of a partial package Medium.
Please redeclare it to any package compatible with 
  Modelica.Media.Interfaces.PartialMedium.
}}}

This would be a lot more useful."	enhancement	closed	blocker	1.9.4	Frontend	trunk	fixed		paolodavide.solano01@…
