MarekMatejak / Physiolibrary

Modelica library for Physiology
BSD 3-Clause "New" or "Revised" License
34 stars 19 forks source link

Non-identical components in extends #38

Closed maltelenz closed 1 year ago

maltelenz commented 1 year ago

Here:

https://github.com/MarekMatejak/Physiolibrary/blob/7b30d59c57b3e95d91468994a767e4fdad5caf33/Physiolibrary/Chemical.mo#L2885-L2886

an element q is defined, equivalent basically to:

Real(final quantity = "MolarFlowRate", final unit = "mol/s")

and the same class also extends Physiolibrary.Chemical.Interfaces.VagueSubstancePort_b which in turn extends Physiolibrary.Chemical.Interfaces.VagueSubstancePort. Here we find:

https://github.com/MarekMatejak/Physiolibrary/blob/7b30d59c57b3e95d91468994a767e4fdad5caf33/Physiolibrary/Chemical.mo#L5124-L5125

However, the specification requires that the two are identical:

Be exactly identical to any element of the flattened enclosing class with the same name and the same level of protection (public or protected) and same contents.