[fpc-pascal] Open array compatibility

Hairy Pixels genericptr at gmail.com
Sat Oct 15 11:16:14 CEST 2022



> On Oct 15, 2022, at 3:58 PM, Michael Van Canneyt <michael at freepascal.org> wrote:
> 
> One reason we do not allow descendents is that if you have a var array, the
> returned value may contain classes of a type that the caller does not expect.
> (This is the same reason why (var value: TObject) requires an exact match in type)
> 

Ah ok, I guess there would need to be an “array of class” like it used with generic param constraints i.e. <T: class>. I’m trying to do some tricks with overloading which is why I ask.

Regards,
	Ryan Joseph



More information about the fpc-pascal mailing list