I've wrote some code that apparently, sometimes delphi likes it, other times it doesn't, the worst thing about it is that the friggin' IDE and/or compiler doesn't want to do anything more until I restart the IDE, the error is:

I've wrote some code that apparently, sometimes delphi likes it, other times it doesn't, the worst thing about it is that the friggin' IDE and/or compiler doesn't want to do anything more until I restart the IDE, the error is:

[DCC FATAL Fatal Error] XXX.dpr(YY): F2084 Internal Error: O616

Delphi version 2010

Where I believe the issue lies is within a generic class that accepts as callback a "Class Of", the reason I say this, is because before creating it, there was no issue, thoughts?

Comments

  1. Private or protected Internal class?

    ReplyDelete
  2. Publicly defined within interface section of the unit.

    ReplyDelete
  3. no, my bad:

    TSomeObject = class(TObject)
    end;

    TSomeObjectClass = class of TSomeObject;

    TSomeListOfObject = class(TList)
    // in this method, I'm grabbing all "AItemTag" elements from "Value", for each "element", create a new instance of "TSomeObject"
    procedure LoadFromXMLElement(const Value: IXMLElement; AItemTag: string; AClass: TSomeObjectClass);
    end;

    ReplyDelete
  4. Anything that can be learned from the line reference?  Does it melt down in the interface declaration, or in the implementation?

    ReplyDelete
  5. well, my code works perfectly, just that, sometimes, when I do a build, the IDE and/or compiler gets scared and doesn't want to build anymore, thus, I have to restart it ):
    I believe it's somewhat related to internal parsing of the IDE, something, somewhere, under some circumstances gets screwed up...

    ReplyDelete
  6. Strange... I have had issues with generics and class "completeness" and visibility- but that snippet looks safe to me.

    ReplyDelete
  7. it is completely safe, the TSomeObject class has a "simple" constructor with no parameters, when creating an instance of the metaclass(?), I do it simply:
    LInstance := TSomeObject(AClass.NewInstance);
    LInstance.Create;
    LInstance...

    maybe that's the place of error for the IDE?

    ReplyDelete
  8. It was the incredible amount of mysterious compiler internal errors when working with generics in D2010 that made me upgrade to XE. This version must have fixed the most outstanding bugs.

    ReplyDelete
  9. Alexander Elagin the best thing about these compiler errors is that there's a place where you can look them up and understand what's happening, not.

    ReplyDelete
  10. Run your code using last version of Delphi. If bug is still reproducible, isolate a test case and submit it to Embarcadero QC.

    ReplyDelete
  11. Do you have Andy's IDE FixPack and Speedup installed (both apply to D2010!)?

    Otherwise, I fear this is time to roll back to an older copy of your development machine and try again - sometime Delphi just gets tangled up (sorry, I've been developing in VMs for so long I don't actually have many "rescue my Delphi install" tips). Or try the "use the latest Delphi" lottery - often works if you avoid using the newer features.

    My general tips: delete everything except the pas, dfm, dproj and dpr files. Then build. Using GExperts "clean directories" can be a start.

    ReplyDelete
  12. Moz Le fixpack is the first thing I install in delphi for years (:

    ReplyDelete
  13. IDEFixPack doesn't help if you have internal compiler errors ;-)

    ReplyDelete
  14. IME it delays the onset of them, though.

    Oh, and rolling back your project files (dproj etc) can also help - check the diffs over time and roll back any bits that don't look useful.

    ReplyDelete

Post a Comment