Island/Delphi simple App does not work

Hi,

I just wanted to play with Island/Delphi support, but I can’t get the smallest thinkable App to run. I have this (almost as in the docs).

namespace DelphiApp1;

uses Delphi.Classes, Delphi.System;

type
Program = class
  public

  class method Main();
  begin
    writeLn('The magic happens here.');
    var lList := new TStringList;
    writeLn('created');
    var s: DelphiAnsiString := 'Hello'; // why do I need an DelphiAnsiString here when compiled with Delphi 13 SDK ?
    lList.Add(s);  //  this crashes at runtime with SDK 13 and complains at compile time when s is a DelphiString !
    writeLn('added');
    writeLn(lList.Text);
    lList.Free;
    var l = new TStringList;
    writeLn('created');
    l.Add('Hello');
    l.Add('World');
    writeLn('added');
    l.Delimiter:= Delphi.System.Char('|'); // note here is a char accepted which doesn't match to DelphiAnsiString with SDK 13
    writeLn(l.DelimitedText);
    l.Free;
    writeLn('done');
    l:= nil;
    lList:= nil;
  end;
end;
end.

I tried this with the Delphi 13 runtime, where String is a UnicodeString in Delphi, not an AnsiString. I guess this causes the crash. IMO this shouldn’t compile when I use the Delphi 13 SDK.

When I try it with the an older Delphi 2007 SDK it compiles as well (this time this is ok, because String is AnsiString), but crashes after the program has finished.

An exception occurred in DelphiApp1, thread 0C74

Type: AccessViolationException

Message:

Code c0000005

Call Stack:

0000000536880687 @System@SysFreeMem$qqrpv rtl100.bpl
0000000000456641 DelphiObjectToString DelphiApp1.exe
0000000000262013 DelphiApp1.Program.Main DelphiApp1.exe (program.pas, line 10)
0000000000200712 __island_force_release DelphiApp1.exe
0000000000249484 RemObjects.Elements.System..main DelphiApp1.exe (windowshelpers.pas, line 1707)
0000000000250072 RemObjects.Elements.System..mainCRTStartup DelphiApp1.exe (windowshelpers.pas, line 1728)
0000001968504009 BaseThreadInitThunk KERNEL32.DLL
0000002003993262 RtlGetAppContainerNamedObjectPath
0000002003993214 RtlGetAppContainerNamedObjectPath

Is the Island/Delphi not yet usable ?

Cheers, Adrian.