-
Type:
Bug
-
Resolution: Fixed
-
Priority:
P4
-
Affects Version/s: 7u40, 8, 8-repo-lambda
-
Component/s: tools
-
b94
-
Verified
This code doesn't compile in JDK 5/6/7:
import java.util.List;
interface B { <X> List m(); }
class Test {
void test(B ab) { List<?> n = ab.m(); }
}
Test.java:26: incompatible types; no instance(s) of type variable(s) X exist so that java.util.List conforms to java.util.List<?>
found : <X>java.util.List
required: java.util.List<?>
void test(B ab) { List<?> n = ab.m(); }
^
1 error
import java.util.List;
interface B { <X> List m(); }
class Test {
void test(B ab) { List<?> n = ab.m(); }
}
Test.java:26: incompatible types; no instance(s) of type variable(s) X exist so that java.util.List conforms to java.util.List<?>
found : <X>java.util.List
required: java.util.List<?>
void test(B ab) { List<?> n = ab.m(); }
^
1 error
- duplicates
-
JDK-7067746 inference causes spurious error messages in assignment check
-
- Closed
-