Creating an alias for functional interface in Java

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
    FProc : TGIS_Proc ;
    property Proc : TGIS_Proc
                    read FProc
                    write FProc ;

It’s implemented like this later on:

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

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?


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 (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.


Yeah id need VS one