For loop with index, and discardable loop variable, gives Internal Error

Elements/Island/Windows - Latest 2484 Build.

The following code gives an Internal Error - I am not sure if this is a compiler issue, or the code itself is NOT syntactically correct. I am reporting here, anyway. @mh @ck

class method Main(args: array of String): Int32;
begin
  var arr := new Int32[10];
  for each nil in arr index i do arr[i] := i;
  readLn;
end;

ConsoleApplication.7z (1.3 KB)

Thanks, logged as bugs://83953

An Internal Error is always a compiler bug :wink:

bugs://83953 got closed with status fixed.