Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

It is the Code inlining control setting in the project options. It doesn't play nice with generics if its set to auto. Setting it to either on or off in my release build allowed it to compile without the internal error.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top