Preserve code block when variable from lambda body conflicts with later declaration

Fixes IDEA-196540 TrivialFunctionalExpressionUsageInspection produces code with variable redefinitions
This commit is contained in:
Tagir Valeev
2018-08-01 20:52:34 +07:00
parent aa9efdf94c
commit b3325f5116
3 changed files with 45 additions and 5 deletions
@@ -0,0 +1,10 @@
// "Replace call with method body" "true"
class Test {
void test() {
{
int a = 6;
}
int a =5;
}
}
@@ -0,0 +1,13 @@
// "Replace call with method body" "true"
class Test {
void test() {
new Runnable() {
@Override
public void run() {
int a =6;
}
}.r<caret>un();
int a =5;
}
}