mORMot2 icon indicating copy to clipboard operation
mORMot2 copied to clipboard

Cannot Compile in Delphi 13.0

Open myonlylonely opened this issue 7 months ago • 12 comments

function TDocVariantData.GetValuesByStartName(const aStartName: RawUtf8;
  TrimLeftStartName: boolean): variant;
//...
    TDocVariant.NewFast(result);
//...

Cannot Compile in Delphi 13.0, this line has F2084 Internel Error C2802.

myonlylonely avatar Sep 11 '25 03:09 myonlylonely

Sounds like a Delphi bug to me.

This code is just correct, and works fine on FPC and all other Delphi revisions:

class procedure TDocVariant.NewFast(out aValue: variant;
  aKind: TDocVariantKind);
begin
  TVarData(aValue) := DV_FAST[aKind];
end;

synopse avatar Sep 11 '25 12:09 synopse

It seems it is a Delphi bug. It seems it has something to do with the inline. If I remove inline, it will compile. I have reported this to emb, hoping they will have some clue through the error code.

myonlylonely avatar Sep 13 '25 13:09 myonlylonely

What if we change:

class procedure TDocVariant.NewFast(out aValue: variant;
  aKind: TDocVariantKind);
begin
  PVarData(@aValue)^ := DV_FAST[aKind];
end;

synopse avatar Sep 15 '25 17:09 synopse

No, it does not help. I have reported this to emb, and they have comfirmed it is a bug, but they didn't say when they will fix this.

myonlylonely avatar Sep 16 '25 01:09 myonlylonely

Bug is for 32bit compilation, 64bit works fine.

LukaszDemczuk avatar Sep 19 '25 07:09 LukaszDemczuk

Do you have an Embarcadero link about the issue?

synopse avatar Sep 19 '25 08:09 synopse

Yes. The status is now changed to open. https://embt.atlassian.net/servicedesk/customer/portal/1/RSS-4091

myonlylonely avatar Sep 19 '25 08:09 myonlylonely

I tried to circumvent the issue. Should not change much in terms of performances.

synopse avatar Sep 19 '25 12:09 synopse

It is now working. I think we should keep this issue open. Emb might fix this in a hot fix, and we could revert this workaround when emb fixes this.

myonlylonely avatar Sep 19 '25 16:09 myonlylonely

The bug is still not fixed by Embarcadero.

Marco wrote it was not their priority, because we made a workaround.

synopse avatar Nov 07 '25 18:11 synopse

Marco replied that they expect this fixed in the next update.

myonlylonely avatar Nov 08 '25 16:11 myonlylonely

If only...

synopse avatar Nov 08 '25 18:11 synopse