Jump to content
Sign in to follow this  
Roger Cigol

RAD Studio 12.3 patch available - April 2025

Recommended Posts

30 minutes ago, Roger Cigol said:

It's called the April patch

Sounds reasonable:

image.thumb.png.964b06bd0472b6244e01d0bfa12d84f7.png

Share this post


Link to post

It is fixed. It is no longer necessary to remove the record constraint to avoid the non-nullable type error.

Edit: Woops - missed that 64-bit thing... do you mean the 64-bit target, or the 64-bit compiler?

Share this post


Link to post
40 minutes ago, Lars Fosdal said:

do you mean the 64-bit target, or the 64-bit compiler?

I think the comment refers to the 64-bit compiler, so that's what I'm asking about. I assume the 64-bit target is okay but since Embarcadero doesn't really provide any useful info (in any of the issues) it's just an assumption.

Share this post


Link to post

@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.

 

  • Thanks 1

Share this post


Link to post
15 minutes ago, Lars Fosdal said:

I just tried my example code which failed before the April patch in the 64-bit IDE, targeting 64-bit Windows.

Try with external MSBuild in the project options and select x64 as preferred architecture. Key is to use the 64-bit compiler versions from the bin64 folder. The target platform is almost irrelevant. Only bcc64x got an update with the April patch.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×