Invert if condition intention: do not remove line breaks #KT-11740 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
dce5cb3ce9
commit
fee74273aa
@@ -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() {}
|
||||
Reference in New Issue
Block a user