﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
2982	sorting of protected variable in a function	Willi Braun	somebody	"Following model fail due to using not initialized memory: 

ModelicaTest.Fluid.Dissipation.Verifications.HeatTransfer.StraightPipe.kc_overall_KC 

It seems that we sort the protected variables in a function wrong or actually we don't sort them at all, if there is an if-expression involved.
{{{
loadString(""
function f
  input Real x;
  output Real y;
protected
  Real a = sin(x);
  Real b = if  x > 0 then cos(c) else sin(c);
  Real c = cos(a);
algorithm
  y := c;
end f;

model A
 Real x(start=1);
equation
  der(x) = f(x);
end A;
""); getErrorString();
simulate(A); getErrorString();
}}}

Where is this sorting performed?



"	defect	new	high	Future	Run-time	trunk			Martin Sjölund
