﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
1311	Better error messages for packages that contain equations are needed!	Adrian Pop	Adrian Pop	"Instantiating this package (thanks to Eric Van Gelder for sending it):
{{{
package steve
  annotation(Diagram(coordinateSystem(extent = {{ -100, -100},{100,100}})));
  Modelica.Electrical.Analog.Sources.SineVoltage blob(V = 10, freqHz = 60) annotation(Placement(transformation(origin = { -5.0, -33.0}, extent = {{ -26.0, -54.0},{16.0, -12.0}}, rotation =  -7.016709e-15), iconTransformation(origin = { -4.0, -33.0}, extent = {{ -25.0, -54.0},{17.0, -12.0}})));
  Modelica.Electrical.Analog.Basic.Inductor glob(L = 10) annotation(Placement(transformation(origin = { -5.0,26.0}, extent = {{ -26.0,5.0},{16.0,47.0}}), iconTransformation(origin = { -5.0,26.0}, extent = {{ -26.0,5.0},{16.0,47.0}})));
  Modelica.Electrical.Analog.Sensors.CurrentSensor slob annotation(Placement(transformation(origin = { -68.0, -2.0}, extent = {{ -89.0, -23.0},{ -47.0,19.0}}, rotation = 90.0), iconTransformation(origin = { -76.0,0.0}, extent = {{ -97.0, -21.0},{ -55.0,21.0}})));
equation 
  connect(glob.n,blob.n) annotation(Line(points = {{16.0,26.0},{42.0,26.0},{42.0, -33.0},{16.0, -33.0}}));
  connect(slob.n,glob.p) annotation(Line(points = {{ -68.0,19.0},{ -67.0,19.0},{ -67.0,25.0},{ -26.0,25.0},{ -26.0,26.0}}));
  connect(blob.p,slob.p) annotation(Line(points = {{ -26.0, -33.0},{ -67.0, -33.0},{ -68.0, -33.0},{ -68.0, -24.0}}));
end steve;
}}}
using this script:
{{{
loadModel(Modelica); getErrorString();
loadFile(""steve.mo""); getErrorString();
instantiateModel(steve); getErrorString();
checkModel(steve); getErrorString();
}}}
gets you this weird error:
{{{
true
""""
true
""""
""""
""[steve.mo:7:3-7:106:writable] Error: Failed to instantiate equation connect(glob.n, blob.n);
Error: Error occured while flattening model steve
[steve.mo:7:3-7:106:writable] Error: Failed to instantiate equation connect(glob.n, blob.n);
Error: Error occured while flattening model steve
""
""[steve.mo:7:3-7:106:writable] Error: Failed to instantiate equation connect(glob.n, blob.n);
Error: Error occured while flattening model steve
""
""""
}}}
We should tell the user (both):\\
* that a package cannot be instantiated\\
* that a package cannot contain equations\\"	defect	closed	high		Instantiation		fixed		Adrian Pop Adrian Pop Per Östlund
