In the below subclass Sub, the inherited class field t should be of type String after performing generic type substitution on the members of the supertype.
However, t seems to be treated as having type T, thus leading to the following compilation error:
File "Bug11.java", line 7, character 25 error: Variable "s" cannot be initialized by a value of type "T" [JLS 4.5.4]
==================
public class Bug11<T> {
public T t;
}
class Sub extends Bug11<String> {
public void foo() {
String s = t;
}
}
==================