Simple enum iteration fails to compile on java

Why does the following code fail to compile on java? I am getting “(E0) Internal error: Object reference not set to an instance of an object.”

namespace EnumJava;

interface

uses
  java.util;

type
  ConsoleApp = class
  public
    class method Main(args: array of String);
  end;

type
  MyEnum = public enum (Bla, Ble, Blu);

implementation

class method ConsoleApp.Main(args: array of String);
begin
  for e: MyEnum := MyEnum.Bla to MyEnum.Blu do
    writeLn(e.ToString);
end;

end.

Thanks, logged as bugs://78522

This properly fails now, java enums aren’t iterable, unless you use integer enums,

bugs://78522 got closed with status fixed.