mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-06-15 15:17:34 +07:00
481bc252f3
(cherry picked from commit d2cbf3f2833104c3a0381059b0d6ef8ac0b3c94c)
21 lines
548 B
Java
21 lines
548 B
Java
class Test {
|
|
static <U> Iterable<U> map(Mapper<? super String, ? extends U> mapper) {
|
|
return null;
|
|
}
|
|
|
|
static void test() {
|
|
Integer next = map(String::length).iterator().next();
|
|
<error descr="Incompatible types. Found: 'java.lang.Object', required: 'java.lang.Integer'">Integer next1 = map(Test::length).iterator().next();</error>
|
|
}
|
|
|
|
public static <T> T length(T s) {
|
|
return null;
|
|
}
|
|
|
|
public static <T> int length(String s) {
|
|
return 0;
|
|
}
|
|
}
|
|
interface Mapper<T, U> {
|
|
U map(T t);
|
|
} |