Fix comment placement on if/else in if or when condition #KT-28224 Fixed

This commit is contained in:
Timo Obereder
2018-11-15 20:04:00 +03:00
committed by Mikhail Glukhikh
parent 520679a2b4
commit ff4279762e
7 changed files with 95 additions and 8 deletions
@@ -0,0 +1,5 @@
fun test(x: Int, b: Boolean) {
val foo = if (x == 1)
if (b) 1 else<caret> 2 // comment
else 0
}
@@ -0,0 +1,7 @@
fun test(x: Int, b: Boolean) {
val foo = if (x == 1)
if (b) 1 else {
2 // comment
}
else 0
}
@@ -0,0 +1,8 @@
fun test(x: Int, b: Boolean) {
val bar = when (x) {
1 ->
if (b) 1 else<caret> 2 // comment
else ->
0
}
}
@@ -0,0 +1,10 @@
fun test(x: Int, b: Boolean) {
val bar = when (x) {
1 ->
if (b) 1 else {
2 // comment
}
else ->
0
}
}