"Replace if with when": do not add empty else block #KT-18681 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
3e207fd6b2
commit
0ae2054af4
@@ -0,0 +1,8 @@
|
||||
fun test(a: Any, b: Boolean): Int {
|
||||
when (a) {
|
||||
is Int -> {
|
||||
<caret>if (b) return 1
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fun test(a: Any, b: Boolean): Int {
|
||||
when (a) {
|
||||
is Int -> {
|
||||
when {
|
||||
b -> return 1
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
Reference in New Issue
Block a user