Jump to content
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.

  • Sad 1

Share this post


Link to post
24 minutes ago, Uwe Raabe said:

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.

Yeah, THAT surfaced the dreaded error

[dcc64 Error] NonNullableConstraint.dpr(41): Type parameter 'T' must be a non-nullable value type

Half-baked patches are no fun. 

Edit - Also noticed that the Error ID is lost when using MSBuild.

 

Share this post


Link to post
10 minutes ago, Lars Fosdal said:

Half-baked patches are no fun. 

I wonder if beta testing for the patches would help here.

Share this post


Link to post
2 minutes ago, Uwe Raabe said:

I wonder if beta testing for the patches would help here.

Aren't we doing that right now?

  • Like 2
  • Haha 2

Share this post


Link to post
40 minutes ago, Lars Fosdal said:

Yeah, THAT surfaced the dreaded error

Thanks.

 

28 minutes ago, Uwe Raabe said:

I wonder if beta testing for the patches would help here.

It would but something like this shouldn't have passed internal QA in the first place.

A compiler engineer would have known that the first thing you do when solving something like this is to write a regression test to first reproduce the problem and later verify that it is fixed. Maybe it would be a good idea if they hired some - compiler engineers, that is.

  • Like 2

Share this post


Link to post
47 minutes ago, dummzeuch said:

Aren't we doing that right now?

Unfortunately not for every patch.

Share this post


Link to post
On 5/6/2025 at 9:25 AM, Uwe Raabe said:

Unfortunately not for every patch.

I thought he was implying that we're beta testing the patch... after it was released.

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

×