This is a compiler Delphi Berlin bug?
This is a compiler Delphi Berlin bug?
[dcc32 Fatal Error] Project1.dpr(18): F2084 Internal Error: C28078
From Docs: TypeHandle is an alias to the TypeInfo intrinsic routine.
Using TypeInfo() make compiler happy:
program Project1;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.Rtti, System.SysUtils;
type
TFoo = class
class procedure Bar;
end;
class procedure TFoo.Bar;
begin
TRttiContext.Create.GetType(TypeHandle(T));
end;
begin
try
TFoo.Bar;
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
end.
[dcc32 Fatal Error] Project1.dpr(18): F2084 Internal Error: C28078
From Docs: TypeHandle is an alias to the TypeInfo intrinsic routine.
Using TypeInfo() make compiler happy:
program Project1;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.Rtti, System.SysUtils;
type
TFoo
class procedure Bar;
end;
class procedure TFoo
begin
TRttiContext.Create.GetType(TypeHandle(T));
end;
begin
try
TFoo
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
end.
It's a bug, which is still present in Delphi Tokyo 10.2.3. I suggest reporting it, here: https://quality.embarcadero.com
ReplyDeletequality.embarcadero.com - System Dashboard - Embarcadero Technologies
This is not a big deal, but here is it:
ReplyDeletequality.embarcadero.com - Log in - Embarcadero Technologies