mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-03 15:50:52 +07:00
lambda: convert anonymous to lambda in invalid context with cast; add cast when functional interface type won't be found otherwise (IDEA-90863)
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
// "Replace with lambda" "true"
|
||||
class Test {
|
||||
{
|
||||
((Runnable) () -> {
|
||||
//To change body of implemented methods use File | Settings | File Templates.
|
||||
}).getClass();;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Replace with lambda" "true"
|
||||
class Test {
|
||||
interface I {
|
||||
|
||||
}
|
||||
interface Bar extends I {
|
||||
int compare(String o1, String o2);
|
||||
}
|
||||
{
|
||||
I bar2 = (Bar) (o1, o2) -> 0;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Replace with lambda" "false"
|
||||
// "Replace with lambda" "true"
|
||||
class Test {
|
||||
{
|
||||
new Ru<caret>nnable() {
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
// "Replace with lambda" "true"
|
||||
class Test {
|
||||
interface I {
|
||||
|
||||
}
|
||||
interface Bar extends I {
|
||||
int compare(String o1, String o2);
|
||||
}
|
||||
{
|
||||
I bar2 = new Ba<caret>r() {
|
||||
@Override
|
||||
public int compare(String o1, String o2) {
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user