-
Bug
-
Resolution: Unresolved
-
P4
-
8-pool, 9
The following program should fail to compile but it doesn't:
import java.util.*;
import java.util.function.*;
class ObjectTargetType {
<T, R> R m(List<? extends R> l1, List<? extends R> l2, Function<String, R> fun) {
return fun.apply(null);
}
void test(List<Class<RuntimeException>> l1, List<Class<Exception>> l2) {
Object o = m(l1, l2, s -> String.class); // error???
}
}
import java.util.*;
import java.util.function.*;
class ObjectTargetType {
<T, R> R m(List<? extends R> l1, List<? extends R> l2, Function<String, R> fun) {
return fun.apply(null);
}
void test(List<Class<RuntimeException>> l1, List<Class<Exception>> l2) {
Object o = m(l1, l2, s -> String.class); // error???
}
}
- is blocked by
-
JDK-8170830 18.5.2: Allow stuck lambdas to be reduced before target type constraint
- Open