﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
5199	Strange diagnostics with diamond-inheriting from a class with equations	anatoly.trosinenko@…	Per Östlund	"When inheriting through different paths from the same class containing both variables and equations, variables are merged and equations are not. Supposing this is correct, diagnostics looks quite strange: it suggests I have ""not big enough"" equation, but the list of unsolved variables is empty -- or does it contain -1 variable?.. :)

== How to reproduce ==

Take the following package:

{{{#!modelica
package TestInheritance

  model Base
    input Real x;
    output Real y;
  equation
    y = x;
  end Base;
  
  model A 
    extends Base;
  end A;
  
  model B
    extends Base;
  end B;
  
  model AB
    extends A;
    extends B;
  end AB;

end TestInheritance;
}}}

... and select the AB model.

Check it:
{{{
Check of TestInheritance.AB completed successfully.
Class TestInheritance.AB has 2 equation(s) and 1 variable(s).
2 of these are trivial equation(s).
}}}

Instantiate it:
{{{#!modelica
class TestInheritance.AB
  input Real x;
  output Real y;
equation
  y = x;
  y = x;
end TestInheritance.AB;
}}}

Frankly speaking, I don't know how this should be handled according to the standard, but up to this point it looks consistent.

Now try to simulate it: you get the following error
{{{
[1] 11:53:00 Symbolic Error
Too many equations, over-determined system. The model has 2 equation(s) and 1 variable(s).

[2] 11:53:00 Symbolic Warning
[TestInheritance: 7:5-7:10]: Equation 2 (size: 1) y = x is not big enough to solve for enough variables.
  Remaining unsolved variables are: 
  Already solved: y
  Equations used to solve those variables:
    Equation 1 (size: 1): y = x
}}}

And this diagnostics looks quite strange.

== What is expected ==

Ideally, the compiler should show a warning (or even error?) explicitly stating two paths of inheritance of `Base`. Can some model with diamond inheritance from a model **with non-zero number of equations** be simulatable at all?"	defect	closed	high	2.0.0	New Instantiation	v1.13.0-dev-nightly	wontfix	diamond inheritance	
