﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
2385	Missing variable declarations in instantiated model when using expandable connectors	carlj@…	Adrian Pop	"Instantiating ExpandableArrayTest.Test below

{{{
package ExpandableArrayTest

  expandable connector B
    Real x;
  end B;

  block Bsource
    output B bout;
  equation
    bout.x = sin(time);
  end Bsource;

  model Areceiver
    input B bin;
    Real y;
  equation
    y = 2 * bin.x;
  end Areceiver;

  model Test
    Areceiver a1;
    Bsource b1;
  equation
    connect(b1.bout,a1.bin);
  end Test;

end ExpandableArrayTest;
}}}

yields the following:

{{{
class ExpandableArrayTest.Test
  Real a1.y;
equation
  a1.y = 2.0 * a1.bin.x;
  b1.bout.x = sin(time);
end ExpandableArrayTest.Test;
}}}

where b1.bout.x and a1.bin.x are used in the equations but have no variable declaration.

If one removes the '''expandable''' qualifier for B the instantiated model is ok:


{{{
class ExpandableArrayTest.Test
  input Real a1.bin.x;
  Real a1.y;
  output Real b1.bout.x;
equation
  a1.y = 2.0 * a1.bin.x;
  b1.bout.x = sin(time);
  a1.bin.x = b1.bout.x;
end ExpandableArrayTest.Test;
}}}
"	defect	reopened	high	2.0.0	New Instantiation	trunk			Peter Aronsson
