-
Bug
-
Resolution: Fixed
-
P3
-
7
-
b64
-
unknown
-
generic
-
Verified
import java.util.Comparator;
import java.util.List;
class Test {
<T extends Comparable<? super T>> Comparator<List<T>> comparator() { return null; }
static <T extends Comparable<? super T>> void f() {
Comparator<List<T>> comparator = comparator(); // [*]
}
}
this program is rejected with the following error message:
type parameters of <T>java.util.Comparator<java.util.List<T>> cannot be determined;
no unique maximal instance exists for type variable T with upper bounds java.lang.Comparable<? super T>
See also http://www.netbeans.org/issues/show_bug.cgi?id=163967
http://www.netbeans.org/issues/show_bug.cgi?id=163969
import java.util.List;
class Test {
<T extends Comparable<? super T>> Comparator<List<T>> comparator() { return null; }
static <T extends Comparable<? super T>> void f() {
Comparator<List<T>> comparator = comparator(); // [*]
}
}
this program is rejected with the following error message:
type parameters of <T>java.util.Comparator<java.util.List<T>> cannot be determined;
no unique maximal instance exists for type variable T with upper bounds java.lang.Comparable<? super T>
See also http://www.netbeans.org/issues/show_bug.cgi?id=163967
http://www.netbeans.org/issues/show_bug.cgi?id=163969
- relates to
-
JDK-6369605 Unconstrained type variables fails to include bounds
-
- Closed
-
-
JDK-6315770 javac inference allows creation of strange types: Integer & Runnable
-
- Closed
-