diff --git a/compiler/testData/diagnostics/tests/Unresolved.kt b/compiler/testData/diagnostics/tests/Unresolved.kt index ada0049f31b..efbfe2799ad 100644 --- a/compiler/testData/diagnostics/tests/Unresolved.kt +++ b/compiler/testData/diagnostics/tests/Unresolved.kt @@ -17,7 +17,7 @@ fun testUnresolved() { foo1(i) s.foo() - when(a) { + when(a) { is Int -> a is String -> a } diff --git a/compiler/testData/diagnostics/tests/controlStructures/kt786.kt b/compiler/testData/diagnostics/tests/controlStructures/kt786.kt index 8240606300d..773211813b6 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/kt786.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/kt786.kt @@ -14,7 +14,7 @@ fun foo() : Int { //test unreachable code fun fff(): Int { var d = 3 - when(d) { + when(d) { 4 -> 21 return 2 -> return 47 bar() -> 45 @@ -23,4 +23,4 @@ fun fff(): Int { return 34 } -fun bar(): Int = 8 +fun bar(): Int = 8 \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/controlStructures/when.kt234.kt973.kt b/compiler/testData/diagnostics/tests/controlStructures/when.kt234.kt973.kt index 9fd46a066a1..c3bf067652b 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/when.kt234.kt973.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/when.kt234.kt973.kt @@ -6,7 +6,7 @@ package kt234_kt973 class Pair(a: A, b: B) fun test(t : Pair) : Int { - when (t) { + when (t) { Pair(10, 10) -> return 1 } return 0 // unreachable code @@ -38,4 +38,4 @@ fun foo3(x: Int) = when(x) { fun foo4(x: Int) = when(x) { 2 -> x else -> 3 -} +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/infos/Autocasts.kt b/compiler/testData/diagnostics/tests/infos/Autocasts.kt index 22751137e1c..3654b6415e2 100644 --- a/compiler/testData/diagnostics/tests/infos/Autocasts.kt +++ b/compiler/testData/diagnostics/tests/infos/Autocasts.kt @@ -146,7 +146,7 @@ fun illegalWhenBody(a: Any): Int = when(a) { is String -> a } fun illegalWhenBlock(a: Any): Int { - when(a) { + when(a) { is Int -> return a is String -> return a } @@ -188,7 +188,7 @@ fun mergeAutocasts(a: Any?) { if (a is Int || a is String) { a.compareTo("") } - when (a) { + when (a) { is String, is Any -> a.compareTo("") } if (a is String && a is Any) { diff --git a/compiler/testData/diagnostics/tests/j+k/kt2619.kt b/compiler/testData/diagnostics/tests/j+k/kt2619.kt index 06e5651e4cf..7930e7fb05e 100644 --- a/compiler/testData/diagnostics/tests/j+k/kt2619.kt +++ b/compiler/testData/diagnostics/tests/j+k/kt2619.kt @@ -1,7 +1,7 @@ //FILE: foo.kt fun main(args: Array) { val c: Type - when (c) { + when (c) { } } diff --git a/idea/testData/checker/infos/Autocasts.kt b/idea/testData/checker/infos/Autocasts.kt index 4f2ea844895..e6d1c7269fa 100644 --- a/idea/testData/checker/infos/Autocasts.kt +++ b/idea/testData/checker/infos/Autocasts.kt @@ -184,7 +184,7 @@ fun mergeAutocasts(a: Any?) { if (a is Int || a is String) { a.compareTo("") } - when (a) { + when (a) { is String, is Any -> a.compareTo("") } if (a is String && a is Any) { diff --git a/idea/testData/quickfix/when/afterNoElseInWhenWithBranches.kt b/idea/testData/quickfix/when/afterNoElseInWhenWithBranches.kt index fa3123674fe..efc0217a0c9 100644 --- a/idea/testData/quickfix/when/afterNoElseInWhenWithBranches.kt +++ b/idea/testData/quickfix/when/afterNoElseInWhenWithBranches.kt @@ -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 -> { diff --git a/idea/testData/quickfix/when/afterNoElseInWhenWithoutBranches.kt b/idea/testData/quickfix/when/afterNoElseInWhenWithoutBranches.kt index 2cc67f46998..fae71abb56b 100644 --- a/idea/testData/quickfix/when/afterNoElseInWhenWithoutBranches.kt +++ b/idea/testData/quickfix/when/afterNoElseInWhenWithoutBranches.kt @@ -1,7 +1,7 @@ // "Add else branch" "true" fun test() { val a = 12 - when (a) { + val x = when (a) { else -> { } } diff --git a/idea/testData/quickfix/when/beforeNoElseInWhenWithBranches.kt b/idea/testData/quickfix/when/beforeNoElseInWhenWithBranches.kt index 7463b2169e6..6edae6f386c 100644 --- a/idea/testData/quickfix/when/beforeNoElseInWhenWithBranches.kt +++ b/idea/testData/quickfix/when/beforeNoElseInWhenWithBranches.kt @@ -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 */ } } diff --git a/idea/testData/quickfix/when/beforeNoElseInWhenWithoutBranches.kt b/idea/testData/quickfix/when/beforeNoElseInWhenWithoutBranches.kt index d351cfccca6..67a0ff8c872 100644 --- a/idea/testData/quickfix/when/beforeNoElseInWhenWithoutBranches.kt +++ b/idea/testData/quickfix/when/beforeNoElseInWhenWithoutBranches.kt @@ -1,6 +1,6 @@ // "Add else branch" "true" fun test() { val a = 12 - when (a) { + val x = when (a) { } } \ No newline at end of file