-
Type:
Bug
-
Resolution: Cannot Reproduce
-
Priority:
P5
-
Affects Version/s: 6
-
Component/s: tools
-
generic
-
generic
This program should continue to not compile:
import java.util.*;
class Test {
private static <T> T method(Collection<? super T> arg) {
return null;
}
private static void test5(Collection<?> arg) {
Class<? extends String> c = method(arg).getClass();
}
}
This program does not compile:
import java.util.*;
class Test {
private static <T> T method(Collection<? super T> arg) {
return null;
}
private static void test4(Collection<? super String> arg) {
Class<? extends String> c = method(arg).getClass();
}
private static void test6(Collection<String> arg) {
Class<? extends String> c = method(arg).getClass();
}
}
import java.util.*;
class Test {
private static <T> T method(Collection<? super T> arg) {
return null;
}
private static void test5(Collection<?> arg) {
Class<? extends String> c = method(arg).getClass();
}
}
This program does not compile:
import java.util.*;
class Test {
private static <T> T method(Collection<? super T> arg) {
return null;
}
private static void test4(Collection<? super String> arg) {
Class<? extends String> c = method(arg).getClass();
}
private static void test6(Collection<String> arg) {
Class<? extends String> c = method(arg).getClass();
}
}
- relates to
-
JDK-6638712 Inference with wildcard types causes selection of inapplicable method
-
- Closed
-
-
JDK-6785112 Umbrella: issues with generic method type-inference
-
- Closed
-
-
JDK-6556628 Unclear if Tj <: A constraints are used outside assignment conversion contexts
-
- Closed
-