Welcome to problems using the downloaded Generics code. DeHL and generics work much better in Delphi XE than in any previous version of Delphi, but it's not the same as "you have no problem." The problems I'm experiencing are exactly like yours.
My opinion is that DeHL shows every sign that it was written by a master-programmer-dolphi, and that this is to some extent a beauty. It is also a source of great pain, not through one's fault.
Delphi contains not one or two, but at least three (maybe four?) Separate parsers, including a full compiler parser, and several IDE parsers used for things like Error Insight (the errors you see, even before creation) and code completion data analyzer. Each of them has different language support restrictions regarding generics. It is possible that DeHL could be written to avoid problems with the parser with all the various Delphi parsers. I have not seen a manual ever written that shows the limitations, but I would not be surprised if complex type declarations like TSomething<TSomething<ISomethingElse>,TBar<IFoo>> break more than a few of these parsers.
If you intend to use Generics very heavily, you can also disable Code Completion and Error Insight. You can also often save and be prepared to experience many problems with the compiler. And don't try to compile generic-heavy code and put it in packages. When I write code based on generics, I experienced a lot of URW and AV (internal compiler errors). I find that the Delphi compiler team does an excellent job of what is being reported, but that Generics are really the most stable for me when I limit myself to using Generics.Collections that come with Delphi and not using other generic code. It seems that you can write material using the generics functions, that the IDE and two-way tools and code completion are not yet fully ready for processing. This means that phenomenal space-based generating capacities stand behind the classic RAD IDE performance capabilities.
As they say, the latest DeHL sources from Subversion work fine for me and build and run without errors, but the very latest ZIP file source for the entire DeHL collection had problems for me.
I expect that over the next few releases of Delphi, whatever problems are found (and DeHL seems to be a great place to push the boundaries, and one of the reasons I am a big fan of this) will be fixed and you wonβt be interested why heavy generics disrupt your IDE functions because they will all work again.
source share