If I define the following types for a class:
class SomeClass<A extends InterfaceA, B extends InterfaceB, C extends B>
While InterfaceB
extends InterfaceA
. B also extends A but there I can’t declare that.
When casting an object of type C
to any of [ B
, InterfaceA
, InterfaceB
], there isn't any warning (as expected).
But when casting C
to A
an unchecked cast warning raises. Why?