Existing tests updated according to "'Else' is not required in 'when' if Unit is expected"

This commit is contained in:
Andrey Breslav
2013-09-12 22:20:25 +02:00
parent c017858f77
commit 69cc11d035
10 changed files with 13 additions and 13 deletions
+1 -1
View File
@@ -184,7 +184,7 @@ fun mergeAutocasts(a: Any?) {
if (a is Int || a is String) {
a.<error descr="[UNRESOLVED_REFERENCE] Unresolved reference: compareTo">compareTo</error>("")
}
<error>when</error> (a) {
when (a) {
is String, is Any -> a.<error descr="[UNRESOLVED_REFERENCE] Unresolved reference: compareTo">compareTo</error>("")
}
if (a is String && a is Any) {
@@ -1,7 +1,7 @@
// "Add else branch" "true"
fun test() {
val a = 12
when (a) {
val x = when (a) {
in 0..11 -> { /* some code */ }
12, 13, 14 -> { /* some code */ }
else -> {<caret>
@@ -1,7 +1,7 @@
// "Add else branch" "true"
fun test() {
val a = 12
when (a) {
val x = when (a) {
else -> {<caret>
}
}
@@ -1,7 +1,7 @@
// "Add else branch" "true"
fun test() {
val a = 12
wh<caret>en (a) {
val x = wh<caret>en (a) {
in 0..11 -> { /* some code */ }
12, 13, 14 -> { /* some code */ }
}
@@ -1,6 +1,6 @@
// "Add else branch" "true"
fun test() {
val a = 12
wh<caret>en (a) {
val x = wh<caret>en (a) {
}
}