[fpc-devel] Sven, please look into "cannot return generic derived class" issue

Sven Barth pascaldragon at googlemail.com
Thu May 24 18:18:46 CEST 2012


On 24.05.2012 17:22, Anthony Walter wrote:
> Sven,
>
> When you have the time could you look at issue #22019 titled "Cannot
> return generic derived class"? I think it's kind of a big issue because
> it prevents anyone from returning a subclass of a generic type. I just
> want to know that's you've read the bug report and see/understand the issue.

Yes, I've seen this report (as well as all other generic reports - at 
least if they have the tag "generics"). :)

> In a nutshell you currently cannot write something like:
>
> function TList<T>.GetEnumerator: TEnumerator<T>;
> begin
>    // TListEnumerator<T> inherits from TEnumerator<T>
>    return TListEnumerator<T>.Create(Self);
> end;
>
> There are other examples, but I think the above and the details provided
> in the bug report should be enough to convey the problem.

*looks at the bug report*

Ah, that was that one. Potentially I have it on my ToDo list already. It 
will depend on how much work it needs whether I'll solve it "now" or 
when I start working on generic methods/functions where I plan to do 
some "cleaning up" of the code related to generics as well.

> Thanks Sven! We all very much appreciate your work!

I try to do as good as my free time allows :)

Regards,
Sven



More information about the fpc-devel mailing list