[fpc-devel] Allow record helper inheritance in Delphi mode

Stefan Glienke sglienke at dsharp.org
Fri Sep 1 14:50:37 CEST 2017


> For generics the only way to support them is that you must explicitly specialize a generic helper type. The compiler won't do any type inference for you.

IMO this makes them rather useless. Is that a technical limitation or just something you did not want to do?
I don't know much about compiler internals for forgive me my naivety.

If I have TFoo<T> and a TFooHelper<T> and somewhere declare a TFoo<Integer> and use a method 
from my helper can't the compiler make sure to compile the TFooHelper<Integer> version for it?

I guess it's because it does not know anymore that TFoo<Integer> is in fact a closed generic type that was constructed from the open geneneric type TFoo<T>?



More information about the fpc-devel mailing list