support method/constructor refs on array types

This commit is contained in:
anna
2013-02-26 16:10:26 +01:00
parent 96abac54cc
commit a41b5c6f85
4 changed files with 65 additions and 12 deletions

View File

@@ -0,0 +1,33 @@
class OnArrayTest {
interface Cln {
Object m(int[] i);
}
interface IA {
void m(int i);
}
interface I {
void m(int[] i);
}
interface Len<T> {
int len(T[] ta);
}
interface ToStr<T> {
String _(T[] ta);
}
public static void main(String[] args) {
Cln s = int[]::clone;
IA a = int[]::new;
<error descr="Incompatible types. Found: '<method reference>', required: 'OnArrayTest.I'">I i = int[]::new;</error>
<error descr="Incompatible types. Found: '<method reference>', required: 'OnArrayTest.Len<java.lang.String>'">Len<String> strLen = String[]::length;</error>
ToStr<Integer> toStr = Integer[]::toString;
}
}