Introduce "Add remaining when branches" intention #KT-23306 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
bde9a57c9e
commit
2c59f96ca4
@@ -0,0 +1 @@
|
||||
org.jetbrains.kotlin.idea.intentions.AddWhenRemainingBranchesIntention
|
||||
@@ -0,0 +1,11 @@
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
enum class Entry {
|
||||
FOO, BAR, BAZ
|
||||
}
|
||||
|
||||
fun test(e: Entry) {
|
||||
<caret>when (e) {
|
||||
Entry.FOO -> {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
enum class Entry {
|
||||
FOO, BAR, BAZ
|
||||
}
|
||||
|
||||
fun test(e: Entry) {
|
||||
<caret>when (e) {
|
||||
Entry.FOO -> {}
|
||||
Entry.BAR -> {}
|
||||
Entry.BAZ -> {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
enum class Entry {
|
||||
FOO, BAR, BAZ
|
||||
}
|
||||
|
||||
fun test(e: Entry) {
|
||||
<caret>when (e) {
|
||||
Entry.FOO -> {}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
enum class Entry {
|
||||
FOO, BAR, BAZ
|
||||
}
|
||||
|
||||
fun test(e: Entry) {
|
||||
<caret>when (e) {
|
||||
Entry.FOO -> {}
|
||||
Entry.BAR -> TODO()
|
||||
Entry.BAZ -> TODO()
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user