Fix intention for when: insert '||' instead of ','
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
fun test(n: Int): String {
|
||||
return <caret>when {
|
||||
n < 0, n > 1000 -> "unknown"
|
||||
n < 0 || n > 1000 -> "unknown"
|
||||
n <= 10 -> "small"
|
||||
n <= 100 -> "average"
|
||||
else -> "big"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// ERROR: Expected condition of type kotlin.Boolean
|
||||
// ERROR: Expected condition of type kotlin.Boolean
|
||||
// SKIP_ERRORS_AFTER
|
||||
|
||||
fun test(n: Int): String {
|
||||
return <caret>when {
|
||||
|
||||
+1
@@ -1,5 +1,6 @@
|
||||
// ERROR: Expected condition of type kotlin.Boolean
|
||||
// ERROR: Expected condition of type kotlin.Boolean
|
||||
// SKIP_ERRORS_AFTER
|
||||
|
||||
fun test(n: Int): String {
|
||||
return if (_ is String) "String"
|
||||
|
||||
+4
-4
@@ -1,8 +1,8 @@
|
||||
fun test(n: Int): String {
|
||||
return <caret>when {
|
||||
n in 0..5, n in 5..10 -> "small"
|
||||
n in 10..50, n in 50..100 -> "average"
|
||||
n in 100..500, n in 500..1000 -> "big"
|
||||
return when {
|
||||
n in 0..5 || n in 5..10 -> "small"
|
||||
n in 10..50 || n in 50..100 -> "average"
|
||||
n in 100..500 || n in 500..1000 -> "big"
|
||||
else -> "unknown"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user