<div dir="ltr">Fellow ChucKists,<br><br>Below you'll find some example code proving that extending a array of instances of a home-made class using ".size()"doesn't properly instantiates the new objects, leading to nullpointers and the shred being dropped. The "<<" operator, using "new" does lead to proper instantiation.<br>
<br>I feel this is a bug.<br><br>Yours,<br>Kas.<br><br>=====================8<==============================<br><br>//instantiate a array of home made classes<br>foo bar[1];<br><br>//check that this works<br><<<"your lucky number is ", bar[0].value>>>;<br>
<br>//grow by one.<br>bar << new foo ;<br><br>//make sure it's instantiated<br><<<"your lucky number is ", bar[1].value>>>;<br><br>//grow by a another one<br>bar.size(bar.size() + 1);<br>
<br>//make sure we did, size should now be 3<br><<<"size is now", bar.size()>>>;<br><br>//try to verify this is instantiated, it won't be<br><<<"your unlucky number is ", bar[2].value>>>;<br>
<br>class foo<br> {<br> Std.rand2(0, 10) => int value;<br> }<br>===================================================<br></div>