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?
[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?
Private or protected Internal class?
ReplyDeletePublicly defined within interface section of the unit.
ReplyDeleteclass of TGeneric ?
ReplyDeleteno, my bad:
ReplyDeleteTSomeObject = 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;
Anything that can be learned from the line reference? Does it melt down in the interface declaration, or in the implementation?
ReplyDeletewell, 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 ):
ReplyDeleteI believe it's somewhat related to internal parsing of the IDE, something, somewhere, under some circumstances gets screwed up...
Strange... I have had issues with generics and class "completeness" and visibility- but that snippet looks safe to me.
ReplyDeleteit is completely safe, the TSomeObject class has a "simple" constructor with no parameters, when creating an instance of the metaclass(?), I do it simply:
ReplyDeleteLInstance := TSomeObject(AClass.NewInstance);
LInstance.Create;
LInstance...
maybe that's the place of error for the IDE?
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.
ReplyDeleteAlexander 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.
ReplyDeleteRun your code using last version of Delphi. If bug is still reproducible, isolate a test case and submit it to Embarcadero QC.
ReplyDeleteDo you have Andy's IDE FixPack and Speedup installed (both apply to D2010!)?
ReplyDeleteOtherwise, 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.
Moz Le fixpack is the first thing I install in delphi for years (:
ReplyDeleteIDEFixPack doesn't help if you have internal compiler errors ;-)
ReplyDeleteIME it delays the onset of them, though.
ReplyDeleteOh, 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.