mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 02:09:59 +07:00
lambda -> method ref: disable for inapplicable target methods (IDEA-103369)
(cherry picked from commit c05e901232c17e1a93a7024e5d7262d6a324c5e3)
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
// "Replace lambda with method reference" "true"
|
||||
class Example {
|
||||
{
|
||||
long[][] avg = collect(long[][]::new);
|
||||
}
|
||||
|
||||
interface P<T> {
|
||||
T _(int i);
|
||||
}
|
||||
|
||||
<T> T collect(P<T> p) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// "Replace lambda with method reference" "true"
|
||||
class Example {
|
||||
{
|
||||
long[][] avg = collect((int i) -> new <caret>long[i][]);
|
||||
}
|
||||
|
||||
interface P<T> {
|
||||
T _(int i);
|
||||
}
|
||||
|
||||
<T> T collect(P<T> p) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// "Replace lambda with method reference" "false"
|
||||
class Example {
|
||||
{
|
||||
long[] avg = collect(() -> new <caret>long[]);
|
||||
}
|
||||
|
||||
interface P<T> {
|
||||
T _();
|
||||
}
|
||||
|
||||
<T> T collect(P<T> p) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user