Relates :
|
|
Relates :
|
Uses of a class like Inner, below, are not parameterized types (per JLS 4.5). class Outer<T> { abstract class Inner { abstract T get(); } static <X> X unwrap(Outer<X>.Inner i) { return i.get(); } static void test(Outer<String>.Inner i) { unwrap(i).substring(3); } } But, clearly, subtype inference should treat it just like a parameterized type. The rules in 18.2.3 should be modified to allow, e.g., x=String to be inferred above.
|