lambda -> method refs: array refs supported

This commit is contained in:
anna
2013-03-04 15:53:07 +01:00
parent 1986b5aa34
commit b298b6a8bc
5 changed files with 63 additions and 2 deletions

View File

@@ -0,0 +1,10 @@
// "Replace lambda with method reference" "true"
class Example {
static void foo() {
Ar<String> a = String[]::new;
}
interface Ar<T> {
T[] _(int p);
}
}

View File

@@ -0,0 +1,10 @@
// "Replace lambda with method reference" "true"
class Example {
static void foo() {
Ar<String> a = String[]::clone;
}
interface Ar<T> {
Object _(T[] p);
}
}

View File

@@ -0,0 +1,10 @@
// "Replace lambda with method reference" "true"
class Example {
static void foo() {
Ar<String> a = p -> new <caret>String[p];
}
interface Ar<T> {
T[] _(int p);
}
}

View File

@@ -0,0 +1,10 @@
// "Replace lambda with method reference" "true"
class Example {
static void foo() {
Ar<String> a = p -> p.c<caret>lone();
}
interface Ar<T> {
Object _(T[] p);
}
}