method refs: testdata

This commit is contained in:
anna
2012-10-02 20:08:33 +02:00
parent ff500e1468
commit 55c8b4db6c
2 changed files with 46 additions and 1 deletions

View File

@@ -14,3 +14,31 @@ class MyTest {
I i = Foo::m;
}
}
class MyTest1 {
interface I1 {
void m(String s);
}
interface I2 {
void m(Integer i);
}
interface I3 {
void m(Object o);
}
static class Foo<T extends Number> {
Foo(T t) {}
}
static void foo(I1 i) {}
static void foo(I2 i) {}
static void foo(I3 i) {}
static {
foo(Foo::new);
}
}

View File

@@ -72,3 +72,20 @@ class MyTest {
}
}
class MyTest2 {
interface IBool { void m(boolean[] a); }
interface IInt { void m(int[] a); }
interface IDbl { void m(double[] a); }
interface IObj { void m(Object[] a); }
static void foo(Object... vi) {}
static {
IBool iBool = MyTest2::foo;
IInt iInt = MyTest2::foo;
IDbl iDbl = MyTest2::foo;
IObj iObj = MyTest2::foo;
}
}