On Sat, Jun 1, 2019 at 6:00 AM Michael Van Canneyt <mich...@freepascal.org> wrote:
> I don't think this syntax is a good idea. > > What with overloads ? > > Procedure MyProc<T>(a:T); > Procedure MyProc(a : TObject); > > How do I know which one will be called ? > I think it would have to work like: if something is a TObject descendant (meaning, any class) and both of those functions were actually in scope, it would always pick the non-generic TObject one for them. Anything that could not validly be cast to TObject would have the generic one picked for it. I can't really think of a good reason that someone would have both versions of the function side-by-side like that in reality, though.
_______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel