IDEA-204717 Can't convert enhanced 'switch' to 'if' if a branch's body contains an end-of-line comment

This commit is contained in:
Tagir Valeev
2018-12-26 21:05:24 +07:00
parent 5457c671f8
commit 7addf9e702
3 changed files with 29 additions and 2 deletions
@@ -0,0 +1,10 @@
// "Replace 'switch' with 'if'" "true"
class Test {
void f(int n, int k) {
if (n == 0) {
if (k == 0) return; //this comment causes the exception IDEA-204717
if (k == 1) {
}
}
}
}
@@ -0,0 +1,12 @@
// "Replace 'switch' with 'if'" "true"
class Test {
void f(int n, int k) {
sw<caret>itch (n) {
case 0 -> {
if (k == 0) return; //this comment causes the exception IDEA-204717
if (k == 1) {
}
}
}
}
}