Internal Error (NRE) with sorting

Hi,
while trying to implement an array sorting/sorter within a class function i get this NRE

RoType 1.bugreport.txt (2.4 KB)
RoType 1.bugreport.zip (4.3 KB)

Wish you happy Easter

Logged as bugs://E27149: Island/Windows: Internal Error (NRE) when passing local method as block

Workaround, this works:

method SortTypes(aTypes: array of UInt64);
begin
  System.Array.Sort(aTypes, (a, b) -> begin
    
    var at:IslandTypeInfo:=new IslandTypeInfo(a,ptrsize,memreader);
    var bt:IslandTypeInfo:=new IslandTypeInfo(a,ptrsize,memreader);
    
    result := at.Hash1.CompareTo(bt.Hash1);
    if result = 0 then
      result := at.Hash2.CompareTo(bt.Hash2);
      
  end);
end;

It’s passing the local method as closure that causes the IE (which may or may not be supported, but of course it should not NRE, either way)