Replace 'if' with 'when': don't swallow comments if there is no synthetic else branch
#KT-34640 Fixed
This commit is contained in:
committed by
Vladimir Dolzhenko
parent
f487118be5
commit
699ea0aa2b
@@ -0,0 +1,12 @@
|
||||
fun test(foo: String) {
|
||||
<caret>if (foo == "1") {
|
||||
println("1")
|
||||
}
|
||||
|
||||
if (foo == "a") {
|
||||
// some comments for "a"
|
||||
println("a");
|
||||
}
|
||||
}
|
||||
|
||||
fun println(s: String) {}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
fun test(foo: String) {
|
||||
when (foo) {
|
||||
"1" -> {
|
||||
println("1")
|
||||
}
|
||||
}
|
||||
|
||||
if (foo == "a") {
|
||||
// some comments for "a"
|
||||
println("a");
|
||||
}
|
||||
}
|
||||
|
||||
fun println(s: String) {}
|
||||
Reference in New Issue
Block a user