﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
4497	Overriding a parameter that sets a parameter in a record has no effect	jwharington@…	somebody	"Consider the following:

{{{

record MyRecord
  Real y;
end MyRecord;

function InitRecord
  input Real  x;
  output MyRecord s(y = x);
end InitRecord;

model test
  parameter Real t = 1;
  parameter MyRecord r = InitRecord (t);

algorithm
  print(""t=""+String(t)+"" "");
  print(""r.y=""+String(r.y)+""\n"");
  assert(t== r.y, ""Correct assignment from structure"");
end test;

}}}

When running this with default values of 't', this works as expected.

However, when overriding 't' on the command line or via _init.xml, the record's parameter is not updated.  In this example program, running the program has an assertion failure:

{{{
./test -override t=2 

t=2 r.y=1
assert            | warning | The following assertion has been violated during initialization at time 0.000000
|                 | |       | t == r.y
assert            | error   | Correct assignment from structure
assert            | info    | simulation terminated by an assertion at initialization

}}}

More information: similar test program which assigns an element of an array works correctly, as does assigning a simple scalar parameter.


"	defect	new	high	Future	*unknown*				
