new overload resolution: testdata

This commit is contained in:
anna
2013-11-06 12:33:10 +01:00
parent 3546317c4d
commit 915fb35af7
4 changed files with 8 additions and 8 deletions

View File

@@ -20,7 +20,7 @@ class MyTest {
static void foo(I3 i) {}
static {
foo(MyTest::m);
foo<error descr="Cannot resolve method 'foo(<method reference>)'">(MyTest::m)</error>;
foo<error descr="Ambiguous method call: both 'MyTest.foo(I1)' and 'MyTest.foo(I2)' match">(MyTest::m1)</error>;
}
}

View File

@@ -39,6 +39,6 @@ class MyTest1 {
static void foo(I3 i) {}
static {
foo(Foo::new);
foo<error descr="Cannot resolve method 'foo(<method reference>)'">(Foo::new)</error>;
}
}

View File

@@ -62,12 +62,12 @@ class MyTest1 {
System.out.println(i);
}
private static void m(I3 i) {
private static void <warning descr="Private method 'm(MyTest1.I3)' is never used">m</warning>(I3 i) {
System.out.println(i);
}
public static void main(String[] args) {
m(Foo::new);
m<error descr="Ambiguous method call: both 'MyTest1.m(I2)' and 'MyTest1.m(I3)' match">(Foo::new)</error>;
}
}
class MyTest2 {

View File

@@ -115,10 +115,10 @@ class MyTest2 {
static void call3(I1 s) {}
static void call3(I2 s) {}
static {
call3(<error descr="Non-static method cannot be referenced from a static context">MyTest2::m1</error>);
call3(MyTest2::m2);
call3(MyTest2::m3);
call3(<error descr="Non-static method cannot be referenced from a static context">MyTest2::m4</error>);
call3<error descr="Cannot resolve method 'call3(<method reference>)'">(MyTest2::m1)</error>;
call3<error descr="Cannot resolve method 'call3(<method reference>)'">(MyTest2::m2)</error>;
call3<error descr="Cannot resolve method 'call3(<method reference>)'">(MyTest2::m3)</error>;
call3<error descr="Cannot resolve method 'call3(<method reference>)'">(MyTest2::m4)</error>;
}
}