﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
6293	Function non-inputs are initialized in the wrong order	Per Östlund	Per Östlund	"Non-input components in functions should according to 12.4.4 be initialized in an order such that a variable isn't used before it has been initialized. The NF does not yet do this, which causes e.g. `ModelicaTest.Fluid.Dissipation.Verifications.HeatTransfer.HeatExchanger.kc_flatTube` to fail during simulation due to using uninitialized variables.

The old frontend handles this by reordering the protecteds component according to their dependencies, but obviously it can't do that with the output components which means it has issues with something like:
{{{#!mo
function f
  input Real x;
  output Real y = z; // OF assigns z to y before z has been initialized
  output Real z = x;
end f;

model M
  Real x, y;
equation
  (x, y) = f(time);
end M;
}}}
We should investigate whether there's some way to specify the initialization order without actually reordering the components so we can handle both protected and output components in the NF. "	defect	new	low		New Instantiation	v1.17.0-dev			
