|
Blocks :
|
|
|
Duplicate :
|
|
|
Duplicate :
|
|
|
Duplicate :
|
|
|
Duplicate :
|
|
|
Duplicate :
|
|
|
Relates :
|
|
|
Relates :
|
|
|
Relates :
|
|
|
Relates :
|
|
|
Relates :
|
|
|
Relates :
|
While attributing this test case:
class Test {
interface Function<X, Y> {
Y m(X x);
}
interface Box<T> {
T get();
<R> R map(Function<T,R> f);
}
static class Person {
Person(String name) { }
}
void print(Object arg) { }
void print(String arg) { }
void test() {
Box<String> b = null;
print(b.map(s -> new Person(s)));
}
}
javac "unsticks" the implicit lambda during overload resolution, thus selecting method print(Object) as applicable. This is incorrect, method print(String) should be the one selected.