-
Bug
-
Resolution: Fixed
-
P2
-
8, 8-repo-lambda
-
b84
-
Verified
This code doesn't compile:
class TestJ8 {
interface Func<A, B> {
B f(A a);
}
class List<X> {
<M> List<M> map(Func<X, M> f) {
return null;
}
<A> List<A> apply(final List<Func<X, A>> lf) {
return null;
}
<B, C> List<C> bind(final List<B> lb, final Func<X, Func<B, C>> f) {
return lb.apply(map(f)); // fails to compile
}
}
}
M is inferred as Object, which causes a spurious inference error.
class TestJ8 {
interface Func<A, B> {
B f(A a);
}
class List<X> {
<M> List<M> map(Func<X, M> f) {
return null;
}
<A> List<A> apply(final List<Func<X, A>> lf) {
return null;
}
<B, C> List<C> bind(final List<B> lb, final Func<X, Func<B, C>> f) {
return lb.apply(map(f)); // fails to compile
}
}
}
M is inferred as Object, which causes a spurious inference error.
- relates to
-
JDK-8039840 Fix deficiencies in isSameType
-
- Closed
-