mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
28 lines
526 B
Java
28 lines
526 B
Java
interface I {
|
|
void m();
|
|
}
|
|
|
|
interface I1<A> {
|
|
void m(A a);
|
|
}
|
|
|
|
interface I2<A> {
|
|
void m(A a1, A a2);
|
|
}
|
|
|
|
interface IV<A> {
|
|
void m(A... as);
|
|
}
|
|
|
|
class AmbiguityVarargs {
|
|
void foo(I s) { }
|
|
void foo(I1<String> s) { }
|
|
void foo(I2<String> s) { }
|
|
void foo(IV<String> s) { }
|
|
|
|
void test() {
|
|
foo(()->{});
|
|
foo<error descr="Ambiguous method call: both 'AmbiguityVarargs.foo(I1<String>)' and 'AmbiguityVarargs.foo(IV<String>)' match">((a1) -> {})</error>;
|
|
foo((a1, a2)->{});
|
|
}
|
|
} |