class R
{
R(){}
}
class C
{
R@ Reference;
C()
{
@Reference = null;
}
}
array<C> Array;
void Main()
{
for (uint i = 0; i < 10; i++)
{
Array.insertLast(C());
}
foreach (C ExampleClass : Array)
{
@ExampleClass.Reference = R();
}
}
Here is the minimal reproduction case, note that replacing the foreach loop at the bottom with a reqular for loop does not make the assertion error show up:
for (uint i = 0; i < Array.Length; i++) // for loop
{
auto ExampleClass = Array[i];
@ExampleClass.Reference = R();
}