﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
4621	[NF] Parameters and constants not in format expected by the backend	Martin Sjölund	Per Östlund	"The new frontend is a little bit weird when it comes to evaluation of constants, for example in the flattened code for the following model only the array dimension is replaced:
{{{#!mo
model M
  constant Integer i = 2;
  Real x[i] = {i,i};
end M;
}}}

{{{#!mo
class M
  constant Integer i = 2;
  Real x[1];
  Real x[2];
equation
  x = {/*Real*/(i), /*Real*/(i)};
end M;
}}}

{{{
Modelica_3.2.1_Modelica.Thermal.HeatTransfer.Examples.TwoMasses.c:85:132: error: use of undeclared identifier '$PModelica$PConstants$PT_zero'
  data->localData[0]->realVars[4] /* Tsensor1.T variable */ = data->localData[0]->realVars[0] /* mass1.T STATE(1,mass1.der_T) */ + $PModelica$PConstants$PT_zero;
}}}

If `i` is changed to a parameter then the backend marks the parameter as changeable. I believe all constants as well as evaluated parameters need to be replaced in a stage before flattening to the DAE structure (but after unit checking) which is a bit hard since the unit checking is currently done on the DAE structure. Perhaps one work-around for that would simply be to mark all constants as ""structural parameters"" to make the (pre-?)backend perform the replacements."	defect	closed	high	Future	New Instantiation		fixed		Lennart Ochel
