FULL PRODUCT VERSION :
A DESCRIPTION OF THE PROBLEM :
public static <T extends List> T newList() {
return null;
}
public static void main(String[] args) {
String s = newList();
}
following code works fine while it should not compile.
0: invokestatic #4 // Method newList:()Ljava/util/List;
3: checkcast #5 // class java/lang/String
the type is inferred correctly but the assignment of a List to String is permitted.
Only happens to interfaces. changing to a concrete class no longer compiles.
REGRESSION. Last worked in version 6u45
REPRODUCIBILITY :
This bug can be reproduced always.