mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
resolve names conflicts inside lambda body (IDEA-120096)
This commit is contained in:
+1
-1
@@ -2,6 +2,6 @@
|
||||
class Test {
|
||||
{
|
||||
String o = "";
|
||||
Comparable<String> c = o1 -> 0;
|
||||
Comparable<String> c = o1 -> o1.length();
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
// "Replace with lambda" "true"
|
||||
public class MyNameConflict {
|
||||
|
||||
{
|
||||
|
||||
int x = 0;
|
||||
|
||||
Comparable<E> c = x1 -> {
|
||||
switch (x1) {
|
||||
case EE:
|
||||
break;
|
||||
}
|
||||
return x1.hashCode();
|
||||
};
|
||||
}
|
||||
|
||||
static enum E {
|
||||
EE;
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -5,7 +5,7 @@ class Test {
|
||||
Comparable<String> c = new Compa<caret>rable<String>() {
|
||||
@Override
|
||||
public int compareTo(String o) {
|
||||
return 0;
|
||||
return o.length();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
// "Replace with lambda" "true"
|
||||
public class MyNameConflict {
|
||||
|
||||
{
|
||||
|
||||
int x = 0;
|
||||
|
||||
Comparable<E> c = new Compara<caret>ble<E>() {
|
||||
@Override
|
||||
public int compareTo(E x) {
|
||||
switch (x) {
|
||||
case EE:
|
||||
break;
|
||||
}
|
||||
return x.hashCode();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
static enum E {
|
||||
EE;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user