Only when keyword should be highlighted in WhenWithOnlyElseInspection
#KT-31673 Fixed
This commit is contained in:
Vendored
+2
-2
@@ -1,10 +1,10 @@
|
||||
fun test() {
|
||||
when (val a = create()) {
|
||||
when<caret> (val a = create()) {
|
||||
else -> {
|
||||
use(a, a)
|
||||
foo()
|
||||
}
|
||||
}<caret>
|
||||
}
|
||||
}
|
||||
|
||||
fun create(): String = ""
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
fun test() {
|
||||
when (val a = create()) {
|
||||
when<caret> (val a = create()) {
|
||||
else -> {
|
||||
use("")
|
||||
foo()
|
||||
}
|
||||
}<caret>
|
||||
}
|
||||
}
|
||||
|
||||
fun create(): String = ""
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
fun test() {
|
||||
when (val a = 42) {
|
||||
when<caret> (val a = 42) {
|
||||
else -> {
|
||||
use("")
|
||||
foo()
|
||||
}
|
||||
}<caret>
|
||||
}
|
||||
}
|
||||
|
||||
fun use(s: String) {}
|
||||
|
||||
Vendored
+2
-2
@@ -1,10 +1,10 @@
|
||||
fun test() {
|
||||
when (val a = create()) {
|
||||
when<caret> (val a = create()) {
|
||||
else -> {
|
||||
use(a)
|
||||
foo()
|
||||
}
|
||||
}<caret>
|
||||
}
|
||||
}
|
||||
|
||||
fun create(): String = ""
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
val x = when (val a = create()) {
|
||||
val x = when<caret> (val a = create()) {
|
||||
else -> {
|
||||
use(a, a)
|
||||
}
|
||||
}<caret>
|
||||
}
|
||||
}
|
||||
|
||||
fun create(): String = ""
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
val x = when (val a = create()) {
|
||||
val x = when<caret> (val a = create()) {
|
||||
else -> {
|
||||
use("")
|
||||
}
|
||||
}<caret>
|
||||
}
|
||||
}
|
||||
|
||||
fun create(): String = ""
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
val x = when (val a = 42) {
|
||||
val x = when<caret> (val a = 42) {
|
||||
else -> {
|
||||
use("")
|
||||
}
|
||||
}<caret>
|
||||
}
|
||||
}
|
||||
|
||||
fun use(s: String) {}
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
val x = when (val a = create()) {
|
||||
val x = when<caret> (val a = create()) {
|
||||
else -> {
|
||||
use(a)
|
||||
}
|
||||
}<caret>
|
||||
}
|
||||
}
|
||||
|
||||
fun create(): String = ""
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
fun hasAnnotation() {
|
||||
when (@Bar val a = create()) {
|
||||
when<caret> (@Bar val a = create()) {
|
||||
else -> use(a)
|
||||
}<caret>
|
||||
}
|
||||
}
|
||||
|
||||
fun create(): String = ""
|
||||
|
||||
Vendored
+2
-2
@@ -1,7 +1,7 @@
|
||||
fun test() {
|
||||
when (val a = create()) {
|
||||
when<caret> (val a = create()) {
|
||||
else -> use(a, a)
|
||||
}<caret>
|
||||
}
|
||||
}
|
||||
|
||||
fun create(): String = ""
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
val x = when (val a = create()) {
|
||||
val x = when<caret> (val a = create()) {
|
||||
else -> use(a, a)
|
||||
}<caret>
|
||||
}
|
||||
}
|
||||
|
||||
fun create(): String = ""
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
fun test() {
|
||||
when (val a = create()) {
|
||||
when<caret> (val a = create()) {
|
||||
else -> use("")
|
||||
}<caret>
|
||||
}
|
||||
}
|
||||
|
||||
fun create(): String = ""
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
fun test() {
|
||||
when (val a = 42) {
|
||||
when<caret> (val a = 42) {
|
||||
else -> use("")
|
||||
}<caret>
|
||||
}
|
||||
}
|
||||
|
||||
fun use(s: String) {}
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
val x = when (val a = create()) {
|
||||
val x = when<caret> (val a = create()) {
|
||||
else -> use("")
|
||||
}<caret>
|
||||
}
|
||||
}
|
||||
|
||||
fun create(): String = ""
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
val x = when (val a = 42) {
|
||||
val x = when<caret> (val a = 42) {
|
||||
else -> use("")
|
||||
}<caret>
|
||||
}
|
||||
}
|
||||
|
||||
fun use(s: String) {}
|
||||
Vendored
+2
-2
@@ -1,7 +1,7 @@
|
||||
fun test() {
|
||||
when (val a = create()) {
|
||||
when<caret> (val a = create()) {
|
||||
else -> use(a)
|
||||
}<caret>
|
||||
}
|
||||
}
|
||||
|
||||
fun create(): String = ""
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
val x = when (val a = create()) {
|
||||
val x = when<caret> (val a = create()) {
|
||||
else -> use(a)
|
||||
}<caret>
|
||||
}
|
||||
}
|
||||
|
||||
fun create(): String = ""
|
||||
|
||||
Reference in New Issue
Block a user