Relates :
|
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.
|