MarekMatejak / Physiolibrary

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

Invalid use of enumeration literal for Integer-indexed array #37

Closed maltelenz closed 1 year ago

maltelenz commented 1 year ago

Here:

https://github.com/MarekMatejak/Physiolibrary/blob/b29e62d9be6cd4ed6c4ecfb56349be7e355c905b/Physiolibrary/Fluid.mo#L3062

An enumeration literal is used to index in lungs.substances.

However, lungs.substances is indexed using an Integer:

https://github.com/MarekMatejak/Physiolibrary/blob/b29e62d9be6cd4ed6c4ecfb56349be7e355c905b/Physiolibrary/Fluid.mo#L702

I believe this is not legal Modelica. The specification says:

The type of the index should correspond to the type used for declaring the dimension of the array.

MarekMatejak commented 1 year ago

Hi Malte, thank you for the feedback. I will fix it on Monday. Kind Regards Marek

maltelenz commented 1 year ago

I saw there were some more models with similar issues, I'm sure you will encounter them during your fix.