Type inference: bug or feature?
Florian Weimer
fweimer at redhat.com
Mon Jul 27 08:21:34 UTC 2020
* Justin Dekeyser:
> Nevertheless, the point was not really about list stuffs, and is not
> related to the lack of co/contra variance.
> You may replace List with any other generic class Foo<T> and Integer
> and Number with any other class satisfying the same inheritance
> relations.
Ahh, well, but why are such casts useful? The results will be wrong in
pretty much every case. Their correctness cannot be checked at run
time, either.
Thanks,
Florian
More information about the core-libs-dev
mailing list