Cannot Compile in Delphi 13.0
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.
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;
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.
What if we change:
class procedure TDocVariant.NewFast(out aValue: variant;
aKind: TDocVariantKind);
begin
PVarData(@aValue)^ := DV_FAST[aKind];
end;
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.
Bug is for 32bit compilation, 64bit works fine.
Do you have an Embarcadero link about the issue?
Yes. The status is now changed to open. https://embt.atlassian.net/servicedesk/customer/portal/1/RSS-4091
I tried to circumvent the issue. Should not change much in terms of performances.
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.
The bug is still not fixed by Embarcadero.
Marco wrote it was not their priority, because we made a workaround.
Marco replied that they expect this fixed in the next update.
If only...