I would personally consider this a
compiler error because there's too much
ambiguity and assumption involved when
choosing one over the other. In my eyes,
the correct choice is too unclear.
Gareth aka. Kit
On Sat 01/06/19 21:41 , Ben Grasset
sent:
On Sat, Jun 1, 2019 at 6:00 AM Michael
Van Canneyt wrote: I don't think
Show quoted text 10 lines
this syntax is a good idea.
What with overloads ?
Procedure MyProc(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.