KT-12040 "Replace when with if" produce invalid code for first entry which has comment

#KT-12040 Fixed
This commit is contained in:
Valentin Kipyatkov
2016-05-04 18:19:34 +03:00
parent 17dacb1efa
commit c45bee5327
4 changed files with 48 additions and 0 deletions
@@ -0,0 +1,11 @@
fun foo(a: Int) {
<caret>when (a) {
// some comment
0 -> bar(a)
// another comment
1 -> bar(a)
}
}
fun bar(p: Int){}
@@ -0,0 +1,10 @@
fun foo(a: Int) {
if (a
// some comment
== 0) bar(a)
// another comment
else if (a == 1) bar(a)
}
fun bar(p: Int){}