I believe this is in the JLS
Here.
If doing a cast of the R ordinary class to the T ordinary class type, ie: (T)R, then R must be either the same class as T or a subclass of T, or a run-time exception is thrown.
In your example, (Subclass)B, consider:
As Jose said, at runtime it makes no sense to try to refer to your object as a
String. o (R) is not a subclass of String (T).
In other words, you can refer to an object using a more general reference in the class hierarchy but not a more specialized one.
Something like that