Invert if condition intention: do not remove line breaks #KT-11740 Fixed

This commit is contained in:
Toshiaki Kameyama
2018-04-16 10:39:45 +03:00
committed by Mikhail Glukhikh
parent dce5cb3ce9
commit fee74273aa
9 changed files with 76 additions and 2 deletions
@@ -6,5 +6,6 @@ fun main() {
a + 1
else
a + 2
} else a
} else
a
}
@@ -0,0 +1,6 @@
fun foo(i: Int): Int {
return <caret>if (i > 0)
i
else
i + 1
}
@@ -0,0 +1,6 @@
fun foo(i: Int): Int {
return if (i <= 0)
i + 1
else
i
}
@@ -0,0 +1,6 @@
fun foo(i: Int): Int {
return <caret>if (i > 0) {
i
} else
i + 1
}
@@ -0,0 +1,7 @@
fun foo(i: Int): Int {
return if (i <= 0)
i + 1
else {
i
}
}
@@ -0,0 +1,8 @@
fun foo(i: Int) {
<caret>if (i > 0)
bar()
else {
}
}
fun bar() {}
@@ -0,0 +1,7 @@
fun foo(i: Int) {
if (i <= 0) {
} else
bar()
}
fun bar() {}