testdata: ensure correct parameters number in functional interface method

This commit is contained in:
Anna Kozlova
2014-04-22 12:48:59 +02:00
parent 1698f7bb29
commit 9aa2f3aaac
2 changed files with 33 additions and 0 deletions

View File

@@ -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) -> {});
}
}

View File

@@ -83,6 +83,10 @@ public class MostSpecificResolutionTest extends LightDaemonAnalyzerTestCase {
doTest();
}
public void testDifferentParamsLength() throws Exception {
doTest(false);
}
private void doTest() {
doTest(true);
}