Use back-ticks correctly in "Add remaining branches" action
So #KT-13985 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
97a3d343f7
commit
0a9e0ddba9
@@ -0,0 +1,10 @@
|
||||
// "Add remaining branches" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
enum class FooEnum {
|
||||
A, B, `C`, `true`, `false`, `null`
|
||||
}
|
||||
|
||||
fun test(foo: FooEnum?) = <caret>when (foo) {
|
||||
FooEnum.A -> "A"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// "Add remaining branches" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
enum class FooEnum {
|
||||
A, B, `C`, `true`, `false`, `null`
|
||||
}
|
||||
|
||||
fun test(foo: FooEnum?) = <caret>when (foo) {
|
||||
FooEnum.A -> "A"
|
||||
FooEnum.B -> TODO()
|
||||
FooEnum.C -> TODO()
|
||||
FooEnum.`true` -> TODO()
|
||||
FooEnum.`false` -> TODO()
|
||||
FooEnum.`null` -> TODO()
|
||||
null -> TODO()
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// "Add remaining branches" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
sealed class FooSealed
|
||||
object A: FooSealed()
|
||||
object B: FooSealed()
|
||||
object `C`: FooSealed()
|
||||
class D: FooSealed()
|
||||
class `true`: FooSealed()
|
||||
class `false`: FooSealed()
|
||||
object `null`: FooSealed()
|
||||
|
||||
fun test(foo: FooSealed?) = <caret>when (foo) {
|
||||
A -> "A"
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
// "Add remaining branches" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
sealed class FooSealed
|
||||
object A: FooSealed()
|
||||
object B: FooSealed()
|
||||
object `C`: FooSealed()
|
||||
class D: FooSealed()
|
||||
class `true`: FooSealed()
|
||||
class `false`: FooSealed()
|
||||
object `null`: FooSealed()
|
||||
|
||||
fun test(foo: FooSealed?) = <caret>when (foo) {
|
||||
A -> "A"
|
||||
B -> TODO()
|
||||
C -> TODO()
|
||||
is D -> TODO()
|
||||
is `true` -> TODO()
|
||||
is `false` -> TODO()
|
||||
`null` -> TODO()
|
||||
null -> TODO()
|
||||
}
|
||||
Reference in New Issue
Block a user