Island-Windows: Compiler crashes on template COM object, with IE 0

The following code will crash the compiler, with Internal Error E0.

type
  [COM, GUID('{8A6E27EB-9D42-4EAF-B362-75B8F8AFC84D}')]
  IEventSink = public interface(IUnknown)
    method ConnectEvents;
    method DisconnectEvents;
    property ConnectionID: Int32 read;
    property IsConnected: Boolean read;  
  end;

  EventSinkBase<T> = public abstract class(IEventSink)
    where T is IUnknown;
  private
    const cUndefinedCoookie = -1;
  private
    var fCookie: Int32;
    var fGuid: GUID;
    var fEventSource: IUnknown;
  private
    method get_ConnectionID: Int32;
    method get_IsConnected: Boolean;
  protected 
    method ConnectEvents; virtual;
    method DisconnectEvents; virtual;
  public
    constructor(aEventSource: IUnknown);
    property ConnectionID: Int32 read get_ConnectionID;
    property IsConnected: Boolean read get_IsConnected;
    property EventSinkGuid: GUID read fGuid;
  end;

Test.7z (4.3 KB)

Thanks, logged as bugs://82780

bugs://82780 got closed with status fixed.

@ck
With this fix, would I be able to use guidOf(T) to get the GUID of the template type parameter?

constructor EventSinkBase<T>(aEventSource: IUnknown);
begin
  fEventSource := aEventSource;
  fCookie := cUndefinedCoookie;
  fGuid := guidOf(T); // Will compiler pass this??
end;

Thanks, logged as bugs://82784

Not yet. Guidof runs too early for that. Will log an issue for.

bugs://82784 got closed with status fixed.