Creating an alias for functional interface in Java

Hi,
I have a question. I need to create an alias for java Consumer. So I came up with:

TGIS_PvlModalResult    = enum ( None, OK, Cancel, Abort ) of Integer ;
TGIS_Proc = public Consumer<TGIS_PvlModalResult    >  ;

TGIS_PvlModalProc = class
  private
    FProc : TGIS_Proc ;
  public
    property Proc : TGIS_Proc
                    read FProc
                    write FProc ;
end;

It’s implemented like this later on:

    proc := TGIS_PvlModalProc.Create ;
    proc.Proc := new interface TGIS_Proc( 
      accept := method( _modal_result : TGIS_PvlModalResult )
      begin
        writeLn( _modal_result ) ;
      end 
    )

But whenever I try to use it I get an Internal error, NullReferanceException (E0).

proc.Proc.accept(TGIS_PvlModalResult.OK) ;

Any idea what would cause it?

Damian,

an internal error is always a compiler bug, by definition, so whether oyour code is coprehct or not, this should not happen/ 'll try to repros wit your snippets, but if yu could send us a full test case, that would greatly help!

Update: reproduced: consoleapplication10 1.bugreport.zip (7.3 KB)

Logged as bugs://E25332.

bugs://E25332 was closed as fixed.

@mh is there any chance to get a daily private build ?

I started one with Water now. If you just need VS, lemme know and I can upload one immediately.

Up.

Yeah id need VS one