mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 21:11:28 +07:00
testdata: ensure correct parameters number in functional interface method
This commit is contained in:
@@ -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) -> {});
|
||||
}
|
||||
}
|
||||
@@ -83,6 +83,10 @@ public class MostSpecificResolutionTest extends LightDaemonAnalyzerTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testDifferentParamsLength() throws Exception {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user