@Anders Melander
I just tried my example code which failed before the April patch in the 64-bit IDE, targeting 64-bit Windows.
It no longer stops compiling.
program NonNullableConstraint;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils;
type
TMyClass = class
function Select<T:Record>(const selector: string):TArray<T>;
end;
TNotifcationRow = record
const
Query = 'SELECT * FROM v_server_notifications';
public
Id: Integer;
Name: String;
Data: String;
ByWho: String;
CreatedWhen: TDateTime;
function DataAsId: Integer;
end;
TServerNotificationArray = TArray<TNotifcationRow>;
{ TMyClass }
function TMyClass.Select<T>(const selector: string): TArray<T>;
begin
end;
procedure Test;
var
MyClass: TMyClass;
Res: TServerNotificationArray;
begin
MyClass := TMyClass.Create;
Res := MyClass.Select<TNotifcationRow>('foo'); // <- E2512 Type parameter 'T' must be a non-nullable value type
end;
{ TNotifcationRow }
function TNotifcationRow.DataAsId: Integer;
begin
Result := 0;
end;
begin
try
Test;
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
end.