-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
7
-
None
-
generic
-
generic
javac accepts this case:
class X {
static <T,U extends Number> void f(T x) { }
public static void main(String[] args) { f(new Integer(37)); }
}
It is claimed that, according to the spec, a type argument that cannot be inferred from the call is supposed to be given the type Object, but Object does not satisfy the bound of U; one would therefore expect a compiler to reject the code.
class X {
static <T,U extends Number> void f(T x) { }
public static void main(String[] args) { f(new Integer(37)); }
}
It is claimed that, according to the spec, a type argument that cannot be inferred from the call is supposed to be given the type Object, but Object does not satisfy the bound of U; one would therefore expect a compiler to reject the code.
- relates to
-
JDK-6488666 inference: lub of typevariables does not yield expected results
- Open
-
JDK-4898773 inference: error in type inference for bounded type parameters
- Closed