COMMA_IN_WHEN_CONDITION_WITHOUT_ARGUMENT is an ERROR now.

Migrated code.
Updated test data in IDE tests.
Dropped whenWithRangeTestsAndMultiConditions.kt:
"Introduce subject" is not applicable to 'when' with ||-ed conditions.
This commit is contained in:
Dmitry Petrov
2015-12-10 12:12:44 +03:00
parent 199827635f
commit 0fe74a8b43
26 changed files with 36 additions and 58 deletions
@@ -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"
@@ -3,7 +3,7 @@ fun test(n: Int): String {
return <caret>when {
n in 0..10 -> "small"
n >= 10 && n <= 100 -> "average"
n < 0, n > 1000 -> "unknown"
n < 0 || n > 1000 -> "unknown"
else -> "big"
}
}
@@ -1,8 +0,0 @@
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"
else -> "unknown"
}
}
@@ -1,8 +0,0 @@
fun test(n: Int): String {
return <caret>when (n) {
in 0..5, in 5..10 -> "small"
in 10..50, in 50..100 -> "average"
in 100..500, in 500..1000 -> "big"
else -> "unknown"
}
}