views:

153

answers:

1

When building my application in release mode, I get an internal error URW1135 at the end of one of my files. I searched the internet and found (here) that it could be about arrays of generic types like

MyClass <T> = class
  FArray : array of T;
end;

So, I applied the proposed workaround (declaring a type TArrayType = array of T) throughout my codebase.

But unfortunately the error is still there. Any ideas what could be wrong?

Surprisingly, in debug mode everything works fine.

Thanks in advance.

+2  A: 

There are a handful of different Generics-related problems still in the D2009 compiler, even after Update 3 fixed a bunch of them. Most of the ones that are left will create compiler fatal errors, with URW 1135 being one of the most common ones. If that solution didn't work, look for others.

The compiler has the most trouble with declaring a specialized generic class in one place and using it somewhere else. For example, in one unit:

type
  TMyList = TObjectList<TMyClass>;

In another unit:

var
  myList: TMyList;

This may or may not cause a compiler error, based mostly on the whims of the Random Number Gods.

I've been working to identify and report as many of these bugs as I can, though I haven't seen any yet that only manifest in Release mode. If you can trace this one down to a specific occurrence, please report it to QC so they can fix it. Hopefully Delphi 2010 will be free of Generics problems.

Mason Wheeler