mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-25 17:07:05 +07:00
anonymous -> lambda: cast if overload would fail (IDEA-144372)
This commit is contained in:
+1
-1
@@ -2,7 +2,7 @@
|
||||
class Test {
|
||||
{
|
||||
((Runnable) () -> {
|
||||
|
||||
|
||||
}).getClass();;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -9,6 +9,6 @@ class Test2 {
|
||||
static <T> I<T> bar(I<T> i){return i;}
|
||||
|
||||
{
|
||||
bar(list -> null);
|
||||
bar((I<String>) list -> null);
|
||||
}
|
||||
}
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// "Replace with lambda" "true"
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
class A {
|
||||
static void submit(Runnable r){}
|
||||
|
||||
static <T> T submit(Callable<T> c){
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
submit((Runnable) () -> new A());
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
// "Replace with lambda" "true"
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
class A {
|
||||
static void submit(Runnable r){}
|
||||
|
||||
static <T> T submit(Callable<T> c){
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
submit(new Run<caret>nable() {
|
||||
@Override
|
||||
public void run() {
|
||||
new A();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user