﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
4269	Record constant in function is initialized wrongly	Martin Sjölund	Lennart Ochel	"{{{#!mo
loadModel(BuildSysPro);getErrorString();
BuildSysPro.BaseClasses.Media.OLD_THERMHYGAERO.AirFunctions.Psat(1.0);getErrorString();
}}}

has a problem because in:
{{{#!mo
record CteAH
   ...
  parameter Real TKref=273.15;
  parameter Real Lv0=AirFunctions.Lv(
      TKref,
      TKref,
      rv);
  ...
end CteAH;
}}}
... Lv0 is not evaluated and in functions containing a variable of type CteAH, the binding for Lv0 is `AirFunctions.Lv(TKref, TKref, rv)`, but `TKref` doesn't exist (the binding is not prefixed / sorted according to the dependencies).

@Julien: Making the record constant instead of parameter would work around the bug in OpenModelica. Adding Modelica_LinearSystems2 to the uses annotation would fix the remaining part to pass code generation of the entire library in OM (see http://libraries.openmodelica.org/branches/master/BuildSysPro/BuildSysPro.html for the report on current status on the OM master)."	defect	closed	high	1.13.0	Code Generation	v1.12.0	fixed		julien.vasseur@…
