Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Compiler/Delphi/Language/Variants    [ Add a report in this area ]  
Report #:  9619   Status: Closed
[Fatal Error] Variants.pas(4333): F2092 Program or unit 'Variants' recursively uses itself
Project:  Delphi Build #:  9.0.1761.24408
Version:    9.0 Submitted By:   Carsten Madsen
Report Type:  Crash / Data loss / Total failure Date Reported:  11/25/2004 7:55:01 AM
Severity:    Critical / Show Stopper Last Updated: 6/16/2005 4:54:04 AM
Platform:    All versions Internal Tracking #:  
Resolution: As Designed (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Unit Variants reports the error: "[Fatal Error] Variants.pas(4333): F2092 Program or unit 'Variants' recursively uses itself" when I compile a project.
I've tried to make a very simple project with only one empty form.

I have just installed Delphi 2005. In Delphi v. 6.0 the error does not appear.

I have tried to delete the new "Variants.pas" and insert the old (version 6.0)-Variants.pas and compile in Delphi 2005: The error raise again. I can see that the old and the new Variants.pas is very different, but I never godt the error with Delphi 6.0
Steps to Reproduce:
procedure VarCopyByRef(var Dest: TVarData; const Source: TVarData);


  case Source.VType and not varByRef of

    varSmallint: Variant(Dest) := PSmallint(Source.VPointer)^;

    varInteger:  Variant(Dest) := PInteger(Source.VPointer)^;

    varSingle:   Variant(Dest) := PSingle(Source.VPointer)^;

    varDouble:   Variant(Dest) := PDouble(Source.VPointer)^;

    varCurrency: Variant(Dest) := PCurrency(Source.VPointer)^;

    varDate:     Variant(Dest) := PDate(Source.VPointer)^;

    varOleStr:   Variant(Dest) := VarCopyNoIndOleStr(Source);

    varBoolean:  Variant(Dest) := PWordBool(Source.VPointer)^;

    varShortInt: Variant(Dest) := PShortInt(Source.VPointer)^;

    varByte:     Variant(Dest) := PByte(Source.VPointer)^;

    varWord:     Variant(Dest) := PWord(Source.VPointer)^;

    varLongWord: Variant(Dest) := PLongWord(Source.VPointer)^;

    varInt64:    Variant(Dest) := PInt64(Source.VPointer)^;

    varVariant:  _VarCopyNoInd(Dest, PVarData(Source.VPointer)^); // Here is the problem


    varUnknown:  VarCopyNoIndViaOS(Dest, Source);


    if Source.VType and varArray <> 0 then

      VarArrayCopyForEach(Dest, Source, VarCopyNoIndCopyProc)


      VarCopyNoIndDeep(Dest, Source);



procedure _VarCopyNoInd(var Dest: TVarData; const Source: TVarData);


  if Source.VType and varByRef = 0 then

    _VarCopy(Dest, Source)


    VarCopyByRef(Dest, Source);  // Here is the problem



Deborah Pate at 11/25/2004 2:24:57 PM -
Check your project's search path.  Remove  (BDS)\source\Win32\rtl\sys from it, so that the Variants unit isn't recompiled with your app (which is no longer allowed).

Building with run-time packages will also cure this.

Server Response from: ETNACODE01