mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-25 14:25:04 +07:00
testdata: ensure correct parameters number in functional interface method
This commit is contained in:
+29
@@ -0,0 +1,29 @@
|
||||
class Test {
|
||||
|
||||
interface I0 {
|
||||
void m();
|
||||
}
|
||||
|
||||
interface I1 {
|
||||
void m(Object a);
|
||||
}
|
||||
|
||||
interface I2 {
|
||||
void m(Object a1, Object a2);
|
||||
}
|
||||
|
||||
interface IVarargs {
|
||||
void m(Object... as);
|
||||
}
|
||||
|
||||
void call(I0 p) { }
|
||||
void call(I1 p) { }
|
||||
void call(I2 p) { }
|
||||
void call(IVarargs p) { }
|
||||
|
||||
void test() {
|
||||
call(() -> { });
|
||||
call<error descr="Ambiguous method call: both 'Test.call(I1)' and 'Test.call(IVarargs)' match">(p1 -> { })</error>;
|
||||
call((p1, p2) -> {});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user