﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
3811	Metarecord usage in bindings not detected	Per Östlund	Martin Sjölund	"The following script generated bad C-code:
{{{#!mo
setCommandLineOptions(""-g=MetaModelica -d=noevalfunc"");

loadString(""
uniontype UT
  record R
    Real x;
  end R;
end UT;

function newR
  input Real x;
  output UT ut = R(x);
end newR;
"");

newR(1.0); getErrorString();
}}}
The error from the C compiler is:
{{{
newR.c:25:32: error: use of undeclared identifier 'UT_R__desc'
  tmpMeta[0] = mmc_mk_box2(3, &UT_R__desc, mmc_mk_real(_x));
}}}
It seems like using the record constructor for R in this way is not detected as a use of R, so no metarecord stuff is generated for it. This situation can arise since it's now possible to assign to a record field directly, so it's quite easy to end up with a function like newR and no other uses of the record constructor. A simple workaround is to just add an algorithm section and do an assignment instead."	defect	new	normal	Future	MetaModelica	v1.10.0-dev-nightly			
