diff --git a/compiler/testData/diagnostics/tests/AutoCreatedIt.kt b/compiler/testData/diagnostics/tests/AutoCreatedIt.kt index 8a91f608b6d..6dc2b04ea2f 100644 --- a/compiler/testData/diagnostics/tests/AutoCreatedIt.kt +++ b/compiler/testData/diagnostics/tests/AutoCreatedIt.kt @@ -2,17 +2,17 @@ fun text() { "direct:a" to "mock:a" "direct:a" on {it.body == ""} to "mock:a" "direct:a" on {it -> it.body == ""} to "mock:a" - bar {1} - bar {it + 1} + bar {1} + bar {it + 1} bar {it, it1 -> it} bar1 {1} bar1 {it + 1} - bar2 {} + bar2 {} bar2 {1} - bar2 {it} - bar2 {it -> it} + bar2 {it} + bar2 {it -> it} } fun bar(f : (Int, Int) -> Int) {} diff --git a/compiler/testData/diagnostics/tests/BinaryCallsOnNullableValues.kt b/compiler/testData/diagnostics/tests/BinaryCallsOnNullableValues.kt index 135111a7019..12895c9072d 100644 --- a/compiler/testData/diagnostics/tests/BinaryCallsOnNullableValues.kt +++ b/compiler/testData/diagnostics/tests/BinaryCallsOnNullableValues.kt @@ -5,10 +5,10 @@ class A() { fun f(): Unit { var x: Int? = 1 x = null - x + 1 + x + 1 x plus 1 x < 1 - x += 1 + x += 1 x == 1 x != 1 @@ -21,7 +21,7 @@ fun f(): Unit { x === 1 x !== 1 - x..2 + x..2 x in 1..2 val y : Boolean? = true diff --git a/compiler/testData/diagnostics/tests/CompareToWithErrorType.kt b/compiler/testData/diagnostics/tests/CompareToWithErrorType.kt index 9896a869e34..de09d46c20f 100644 --- a/compiler/testData/diagnostics/tests/CompareToWithErrorType.kt +++ b/compiler/testData/diagnostics/tests/CompareToWithErrorType.kt @@ -1,5 +1,5 @@ fun test() { - if (x > 0) { + if (x > 0) { } } diff --git a/compiler/testData/diagnostics/tests/DefaultValuesTypechecking.kt b/compiler/testData/diagnostics/tests/DefaultValuesTypechecking.kt index 5ae410941ce..bf8107c328a 100644 --- a/compiler/testData/diagnostics/tests/DefaultValuesTypechecking.kt +++ b/compiler/testData/diagnostics/tests/DefaultValuesTypechecking.kt @@ -15,13 +15,13 @@ val z = 3 fun foo(x: Int = y, y: Int = x, i : Int = z): Int = x + y -fun foo(x: () -> Int = { y }, y: Int = x(), i : Int = z): Int = x() + y +fun foo(x: () -> Int = { y }, y: Int = x(), i : Int = z): Int = x() + y -fun bar(x: () -> Int = { y; 1 }, y: Int) {} +fun bar(x: () -> Int = { y; 1 }, y: Int) {} fun baz( x: () -> Int = { - fun bar(xx: () -> Int = { y; 1 }) = xx + fun bar(xx: () -> Int = { y; 1 }) = xx bar()() }, y: Int @@ -30,7 +30,7 @@ fun baz( fun boo( x: () -> Int = { - fun bar(): Int = y + fun bar(): Int = y bar() }, y: Int diff --git a/compiler/testData/diagnostics/tests/FunctionCalleeExpressions.kt b/compiler/testData/diagnostics/tests/FunctionCalleeExpressions.kt index f09c9082616..03c630f7405 100644 --- a/compiler/testData/diagnostics/tests/FunctionCalleeExpressions.kt +++ b/compiler/testData/diagnostics/tests/FunctionCalleeExpressions.kt @@ -29,26 +29,26 @@ fun fooT2() : (t : T) -> T { fun main(args : Array) { args.foo()() args.foo1()() - a.foo1()() - a.foo1()(a) + a.foo1()() + a.foo1()(a) args.foo1()(1) args.foo1()("1") - a.foo1()("1") - a.foo1()(a) + a.foo1()("1") + a.foo1()(a) foo2()({}) foo2(){} (foo2()){} - (foo2()){x -> } - foo2()({x -> }) + (foo2()){x -> } + foo2()({x -> }) val a = fooT1(1)() checkSubtype(a) val b = fooT2()(1) checkSubtype(b) - fooT2()(1) // : Any? + fooT2()(1) // : Any? 1() 1{} @@ -78,7 +78,7 @@ fun main1() { fun test() { {x : Int -> 1}(); (fun Int.() = 1)() - "sd".(fun Int.() = 1)() + "sd".(fun Int.() = 1)() val i : Int? = null i.(fun Int.() = 1)(); {}() diff --git a/compiler/testData/diagnostics/tests/FunctionReturnTypes.kt b/compiler/testData/diagnostics/tests/FunctionReturnTypes.kt index a3227ad6bd3..3b6a8a3cf07 100644 --- a/compiler/testData/diagnostics/tests/FunctionReturnTypes.kt +++ b/compiler/testData/diagnostics/tests/FunctionReturnTypes.kt @@ -145,14 +145,14 @@ fun illegalConstantBlock(): String { return 1 } fun illegalIfBody(): Int = - if (1 < 2) 'a' else { 1.0 } + if (1 < 2) 'a' else { 1.0 } fun illegalIfBlock(): Boolean { if (1 < 2) return false else { return 1 } } fun illegalReturnIf(): Char { - return if (1 < 2) 'a' else { 1 } + return if (1 < 2) 'a' else { 1 } } fun returnNothing(): Nothing { diff --git a/compiler/testData/diagnostics/tests/InvokeAndRecursiveResolve.kt b/compiler/testData/diagnostics/tests/InvokeAndRecursiveResolve.kt index 6628cb9d72f..81c5605959f 100644 --- a/compiler/testData/diagnostics/tests/InvokeAndRecursiveResolve.kt +++ b/compiler/testData/diagnostics/tests/InvokeAndRecursiveResolve.kt @@ -13,6 +13,6 @@ class B { } class C { - val bar = test() - val test = bar() + val bar = test() + val test = bar() } diff --git a/compiler/testData/diagnostics/tests/Nullability.fir.kt b/compiler/testData/diagnostics/tests/Nullability.fir.kt index 8d5ec364e26..edbc6d50f1a 100644 --- a/compiler/testData/diagnostics/tests/Nullability.fir.kt +++ b/compiler/testData/diagnostics/tests/Nullability.fir.kt @@ -145,7 +145,7 @@ fun test() { out?.println(); val out2 : java.io.PrintStream? = null - + while (out2 == null) { out2?.println(); out2.println(); diff --git a/compiler/testData/diagnostics/tests/Nullability.kt b/compiler/testData/diagnostics/tests/Nullability.kt index 3889d2be13c..0bd4db0df4d 100644 --- a/compiler/testData/diagnostics/tests/Nullability.kt +++ b/compiler/testData/diagnostics/tests/Nullability.kt @@ -145,10 +145,10 @@ fun test() { out?.println(); val out2 : java.io.PrintStream? = null - + while (out2 == null) { out2?.println(); - out2.println(); + out2.println(); } out2.println() diff --git a/compiler/testData/diagnostics/tests/PackageQualified.kt b/compiler/testData/diagnostics/tests/PackageQualified.kt index 489e40cebc6..4079d93c9c3 100644 --- a/compiler/testData/diagnostics/tests/PackageQualified.kt +++ b/compiler/testData/diagnostics/tests/PackageQualified.kt @@ -24,7 +24,7 @@ package foobar.a // FILE: d.kt package foobar -val x1 = a.a +val x1 = a.a val x2 = foobar.a.a val y1 = foobar.a.b diff --git a/compiler/testData/diagnostics/tests/QualifiedExpressions.kt b/compiler/testData/diagnostics/tests/QualifiedExpressions.kt index 969ef63c950..95ac6af0932 100644 --- a/compiler/testData/diagnostics/tests/QualifiedExpressions.kt +++ b/compiler/testData/diagnostics/tests/QualifiedExpressions.kt @@ -4,8 +4,8 @@ fun test(s: IntRange?) { val a: Int = s?.start val b: Int? = s?.start val c: Int = s?.start ?: -11 - val d: Int = s?.start ?: "empty" - val e: String = s?.start ?: "empty" + val d: Int = s?.start ?: "empty" + val e: String = s?.start ?: "empty" val f: Int = s?.endInclusive ?: b ?: 1 val g: Boolean? = e.startsWith("s")//?.length } diff --git a/compiler/testData/diagnostics/tests/RecursiveTypeInference.kt b/compiler/testData/diagnostics/tests/RecursiveTypeInference.kt index c6927a7d29a..b6ca0bf304b 100644 --- a/compiler/testData/diagnostics/tests/RecursiveTypeInference.kt +++ b/compiler/testData/diagnostics/tests/RecursiveTypeInference.kt @@ -4,7 +4,7 @@ package a val foo = bar() - fun bar() = foo + fun bar() = foo // FILE: b.kt package b diff --git a/compiler/testData/diagnostics/tests/ReserveYield.kt b/compiler/testData/diagnostics/tests/ReserveYield.kt index c55b07f3b0d..0cffa3afc08 100644 --- a/compiler/testData/diagnostics/tests/ReserveYield.kt +++ b/compiler/testData/diagnostics/tests/ReserveYield.kt @@ -19,7 +19,7 @@ fun yield(yield: Int) { val foo = yield + yield val foo2 = yield - bar(yield = 5) + bar(yield = 5) yield(4) yield {} diff --git a/compiler/testData/diagnostics/tests/ResolveOfJavaGenerics.kt b/compiler/testData/diagnostics/tests/ResolveOfJavaGenerics.kt index 337e628f7b6..6d440cd35e6 100644 --- a/compiler/testData/diagnostics/tests/ResolveOfJavaGenerics.kt +++ b/compiler/testData/diagnostics/tests/ResolveOfJavaGenerics.kt @@ -4,7 +4,7 @@ fun test(a : java.lang.annotation.RetentionPolicy) { } fun test() { - java.util.Collections.emptyList() + java.util.Collections.emptyList() val a : Collection? = java.util.Collections.emptyList() } diff --git a/compiler/testData/diagnostics/tests/ResolveToJava.kt b/compiler/testData/diagnostics/tests/ResolveToJava.kt index 974cd4d6a9b..41451b3c014 100644 --- a/compiler/testData/diagnostics/tests/ResolveToJava.kt +++ b/compiler/testData/diagnostics/tests/ResolveToJava.kt @@ -21,10 +21,10 @@ fun test(l : java.util.List) { val f : java.io.File? = null - Collections.emptyList + Collections.emptyList Collections.emptyList Collections.emptyList() - Collections.emptyList() + Collections.emptyList() checkSubtype?>(Collections.singleton(1)) Collections.singleton(1.0) diff --git a/compiler/testData/diagnostics/tests/SafeCallUnknownType.kt b/compiler/testData/diagnostics/tests/SafeCallUnknownType.kt index 613cb02324c..e7644d6e967 100644 --- a/compiler/testData/diagnostics/tests/SafeCallUnknownType.kt +++ b/compiler/testData/diagnostics/tests/SafeCallUnknownType.kt @@ -2,5 +2,5 @@ import com.unknownunknown() - val b = a?.plus(42) + val b = a?.plus(42) } diff --git a/compiler/testData/diagnostics/tests/StarsInFunctionCalls.kt b/compiler/testData/diagnostics/tests/StarsInFunctionCalls.kt index 136c64c41d4..9dff6da198f 100644 --- a/compiler/testData/diagnostics/tests/StarsInFunctionCalls.kt +++ b/compiler/testData/diagnostics/tests/StarsInFunctionCalls.kt @@ -1,14 +1,13 @@ - fun getT() {} fun getTT() {} fun getTTT(x : Any) {} fun foo(a : Any?) {} public fun main() { - getT<*>() + getT<*>() ggetT<*>() - getTT<*, *>() - getTT<*, Int>() - getTT*>() - foo(getTTT*, Int>(1)) + getTT<*, *>() + getTT<*, Int>() + getTT*>() + foo(getTTT*, Int>(1)) } diff --git a/compiler/testData/diagnostics/tests/TypeInference.kt b/compiler/testData/diagnostics/tests/TypeInference.kt index ecb0a45bf27..c183d978ee3 100644 --- a/compiler/testData/diagnostics/tests/TypeInference.kt +++ b/compiler/testData/diagnostics/tests/TypeInference.kt @@ -9,10 +9,10 @@ fun main() { val a : C = C(); val x : C = C() val y : C = C() - val z : C<*> = C() + val z : C<*> = C() val ba : C = bar(); val bx : C = bar() val by : C = bar() - val bz : C<*> = bar() + val bz : C<*> = bar() } diff --git a/compiler/testData/diagnostics/tests/annotations/AmbigiousAnnotationConstructor.kt b/compiler/testData/diagnostics/tests/annotations/AmbigiousAnnotationConstructor.kt index 8f133360364..bc545469afc 100644 --- a/compiler/testData/diagnostics/tests/annotations/AmbigiousAnnotationConstructor.kt +++ b/compiler/testData/diagnostics/tests/annotations/AmbigiousAnnotationConstructor.kt @@ -1,5 +1,5 @@ import java.util.ArrayList -@ArrayList(1, 1) fun b() {} +@ArrayList(1, 1) fun b() {} @Xoo(x) fun c() {} @java.lang.Deprecated(x) fun a() {} diff --git a/compiler/testData/diagnostics/tests/annotations/annotationRenderingInTypes.kt b/compiler/testData/diagnostics/tests/annotations/annotationRenderingInTypes.kt index 944951ae971..bc172cb6c39 100644 --- a/compiler/testData/diagnostics/tests/annotations/annotationRenderingInTypes.kt +++ b/compiler/testData/diagnostics/tests/annotations/annotationRenderingInTypes.kt @@ -12,7 +12,7 @@ annotation class Ann fun <@Ann R : @Ann Any> f3(a: Array<@Ann R>): Array<@Ann R?> = null!! fun test2(a: @Ann Array) { - val r: Array = f3(a) + val r: Array = f3(a) } @@ -22,4 +22,4 @@ var test3: Int = 0 fun f4(fn: (@Ann Int, @Ann Int) -> Unit) {} -val test4 = f4 Unit; (Int) -> Unit")!>{ single -> } +val test4 = f4 Unit; (Int) -> Unit")!>{ single -> } diff --git a/compiler/testData/diagnostics/tests/annotations/options/functions.kt b/compiler/testData/diagnostics/tests/annotations/options/functions.kt index 5d1a0dfa987..e414b0ff109 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/functions.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/functions.kt @@ -33,7 +33,7 @@ fun foo(arg: Int) { val f = @FunAnn fun(): Int { return 42 } // But here, f and gav should be annotated instead bar(@FunAnn f) - bar(@FunAnn ::gav) + bar(@FunAnn ::gav) // Function expression, ok fast(f) } diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/field.fir.kt b/compiler/testData/diagnostics/tests/annotations/options/targets/field.fir.kt index ffa9d4ec5f2..ff31b52ad0c 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/field.fir.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/field.fir.kt @@ -1,4 +1,4 @@ -@Target(AnnotationTarget.FIELD) +@Target(AnnotationTarget.FIELD) annotation class Field @Field diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/field.kt b/compiler/testData/diagnostics/tests/annotations/options/targets/field.kt index 82e14460c33..9db29699fb9 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/field.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/field.kt @@ -1,4 +1,4 @@ -@Target(AnnotationTarget.FIELD) +@Target(AnnotationTarget.FIELD) annotation class Field @Field @@ -27,7 +27,7 @@ abstract class My(@Field arg: Int, @Field val w: I fun foo() {} @Field - val v: Int by Delegates.lazy { 42 } + val v: Int by Delegates.lazy { 42 } } enum class Your { diff --git a/compiler/testData/diagnostics/tests/annotations/rendering/memberProjectedOut.kt b/compiler/testData/diagnostics/tests/annotations/rendering/memberProjectedOut.kt index ac01f082922..a8d28e01d5b 100644 --- a/compiler/testData/diagnostics/tests/annotations/rendering/memberProjectedOut.kt +++ b/compiler/testData/diagnostics/tests/annotations/rendering/memberProjectedOut.kt @@ -11,5 +11,5 @@ class C { } fun test(a: C) { - ")!>a[1] = 25 + a[1] = 25 } diff --git a/compiler/testData/diagnostics/tests/annotations/rendering/typeMismatchDueToTypeProjections.kt b/compiler/testData/diagnostics/tests/annotations/rendering/typeMismatchDueToTypeProjections.kt index 1d36df574a1..b105f4c74e2 100644 --- a/compiler/testData/diagnostics/tests/annotations/rendering/typeMismatchDueToTypeProjections.kt +++ b/compiler/testData/diagnostics/tests/annotations/rendering/typeMismatchDueToTypeProjections.kt @@ -13,5 +13,5 @@ class C { class Out fun test(a: C, y: Out) { - a + ; Out"), TYPE_MISMATCH_DUE_TO_TYPE_PROJECTIONS{OI}!>y + a + ; Out")!>y } diff --git a/compiler/testData/diagnostics/tests/callableReference/bound/reservedExpressionSyntax3.kt b/compiler/testData/diagnostics/tests/callableReference/bound/reservedExpressionSyntax3.kt index 3da97d10970..2f31e39ee14 100644 --- a/compiler/testData/diagnostics/tests/callableReference/bound/reservedExpressionSyntax3.kt +++ b/compiler/testData/diagnostics/tests/callableReference/bound/reservedExpressionSyntax3.kt @@ -22,7 +22,7 @@ class Test { val Int.c: Int get() = 42 val test1: () -> Right = a.b<Int>.c::foo - val test1a: () -> Right = a.b.c::foo + val test1a: () -> Right = a.b.c::foo val test2: () -> Right = a.b<Int>.c?::foo } diff --git a/compiler/testData/diagnostics/tests/callableReference/constraintFromLHSWithCorrectDirection.kt b/compiler/testData/diagnostics/tests/callableReference/constraintFromLHSWithCorrectDirection.kt index 7d33d7349a6..418bc461dce 100644 --- a/compiler/testData/diagnostics/tests/callableReference/constraintFromLHSWithCorrectDirection.kt +++ b/compiler/testData/diagnostics/tests/callableReference/constraintFromLHSWithCorrectDirection.kt @@ -18,6 +18,6 @@ fun B.star(p: KProperty1<*, V>): B = TODO() fun B.test(){ foo(A::bla) bar(A::bla) - baz(A::bla) + baz(A::bla) star(A::bla) } diff --git a/compiler/testData/diagnostics/tests/callableReference/expectedTypeAsSubtypeOfFunctionType.kt b/compiler/testData/diagnostics/tests/callableReference/expectedTypeAsSubtypeOfFunctionType.kt index dcb991c8b1d..3ceb29501a0 100644 --- a/compiler/testData/diagnostics/tests/callableReference/expectedTypeAsSubtypeOfFunctionType.kt +++ b/compiler/testData/diagnostics/tests/callableReference/expectedTypeAsSubtypeOfFunctionType.kt @@ -7,6 +7,6 @@ fun takeIt(x: T, f: SubFunction) {} fun cr() {} fun test() { - takeIt(42, ::cr) - takeIt(42, { }) + takeIt(42, ::cr) + takeIt(42, { }) } diff --git a/compiler/testData/diagnostics/tests/callableReference/function/lhsNotAClass.kt b/compiler/testData/diagnostics/tests/callableReference/function/lhsNotAClass.kt index 8621ecaae83..61306257bb7 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/lhsNotAClass.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/lhsNotAClass.kt @@ -1,13 +1,12 @@ - class A { fun foo() = T::toString fun bar() = U::toString fun baz() { - take(T::toString) + take(T::toString) - take(U::toString) + take(U::toString) } } diff --git a/compiler/testData/diagnostics/tests/callableReference/function/unresolved.kt b/compiler/testData/diagnostics/tests/callableReference/function/unresolved.kt index 0a242d0617b..75679f80817 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/unresolved.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/unresolved.kt @@ -17,7 +17,7 @@ fun test2() { fun foo() {} Unresolved::foo - foo(Unresolved::foo) - foo(Unresolved::unresolved) + foo(Unresolved::foo) + foo(Unresolved::unresolved) ::unresolved } diff --git a/compiler/testData/diagnostics/tests/callableReference/functionReferenceWithDefaultValueAsOtherFunctionType.kt b/compiler/testData/diagnostics/tests/callableReference/functionReferenceWithDefaultValueAsOtherFunctionType.kt index 334271c468d..ad0711f7944 100644 --- a/compiler/testData/diagnostics/tests/callableReference/functionReferenceWithDefaultValueAsOtherFunctionType.kt +++ b/compiler/testData/diagnostics/tests/callableReference/functionReferenceWithDefaultValueAsOtherFunctionType.kt @@ -1,4 +1,3 @@ - fun foo(a: String, b: Int = 5): String { return a + b } @@ -12,6 +11,6 @@ fun bar2(body: (String, Int) -> String): String { } fun test() { - bar1(::foo) + bar1(::foo) bar2(::foo) } diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/argumentAndReturnExpectedType.kt b/compiler/testData/diagnostics/tests/callableReference/generic/argumentAndReturnExpectedType.kt index 2535ec64d81..d1c7611a22a 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/argumentAndReturnExpectedType.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/argumentAndReturnExpectedType.kt @@ -15,9 +15,9 @@ fun test1() { bar("", 1, ::foo).checkType { _>() } bar("", 1, ::fooReturnInt).checkType { _>() } bar("", 1, ::fooTakeString).checkType { _>() } - bar("", "", ::fooReturnInt).checkType { _>() } + bar("", "", ::fooReturnInt).checkType { _>() } - val x: String = bar("", "", ::fooReturnInt) + val x: String = bar("", "", ::fooReturnInt) baz(Int::toString, ::foo).checkType { _>() } } diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/explicitTypeArguments.kt b/compiler/testData/diagnostics/tests/callableReference/generic/explicitTypeArguments.kt index 9d6b98b366c..17e5909d00c 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/explicitTypeArguments.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/explicitTypeArguments.kt @@ -13,12 +13,12 @@ fun Wrapper.baz(transform: (T) -> Unit): T = TODO() fun test() { takeFun(::foo) - takeFun(::fooInt) + takeFun(::fooInt) callFun>(::createWrapper) callFun>(::createWrapper) callFun>(::createWrapper) - callFun>(::createWrapper) + callFun>(::createWrapper) callFun>(::createWrapper).baz(::foo) } diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/genericExtensionFunction.kt b/compiler/testData/diagnostics/tests/callableReference/generic/genericExtensionFunction.kt index 6616f4dbc76..d61a59e0f0e 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/genericExtensionFunction.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/genericExtensionFunction.kt @@ -22,8 +22,8 @@ fun test1() { fun test2() { bar(Wrapper::fooReturnString).checkType { _>() } bar(Wrapper::fooReturnString).checkType { _>() } - bar(Wrapper::fooReturnString) - bar(Wrapper::fooReturnString) + bar(Wrapper::fooReturnString) + bar(Wrapper::fooReturnString) bar(Wrapper::fooTakeInt).checkType { _>() } bar(Wrapper::fooTakeInt).checkType { _>() } diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/genericFunctionsWithNullableTypes.kt b/compiler/testData/diagnostics/tests/callableReference/generic/genericFunctionsWithNullableTypes.kt index 626ec1d80aa..a5573ce9a2a 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/genericFunctionsWithNullableTypes.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/genericFunctionsWithNullableTypes.kt @@ -28,9 +28,9 @@ fun test(x: T) { baz(1, null, ::foo) baz(null, null, ::foo) - val s3: Pair = bar(null, null, ::foo) - val s4: Pair = bar(null, null, ::foo) + val s3: Pair = bar(null, null, ::foo) + val s4: Pair = bar(null, null, ::foo) - val s5: Pair = bar(1, "", ::foo) + val s5: Pair = bar(1, "", ::foo) val (a1: Int, b1: String) = bar(1, "", ::foo) } diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/nestedCallWithOverload.kt b/compiler/testData/diagnostics/tests/callableReference/generic/nestedCallWithOverload.kt index 7ad636cc159..272e268df22 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/nestedCallWithOverload.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/nestedCallWithOverload.kt @@ -10,7 +10,7 @@ fun test() { val x2: (Int) -> Unit = baz(id(::foo), ::foo) val x3: (Int) -> Unit = baz(id(::foo), id(id(::foo))) val x4: (String) -> Unit = baz(id(::foo), id(id(::foo))) - val x5: (Double) -> Unit = baz(id(::foo), id(id(::foo))) + val x5: (Double) -> Unit = baz(id(::foo), id(id(::foo))) id<(Int) -> Unit>(id(id(::foo))) diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/resolutionGenericCallableWithNullableTypes.kt b/compiler/testData/diagnostics/tests/callableReference/generic/resolutionGenericCallableWithNullableTypes.kt index 9fe46e1f2e3..2988960d9d8 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/resolutionGenericCallableWithNullableTypes.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/resolutionGenericCallableWithNullableTypes.kt @@ -16,7 +16,7 @@ fun test1() { baz(::foo).checkType { _() } baz(::foo).checkType { _() } - val b1: Int = baz(::foo) - val b2: String = baz(::foo) - val b3: Boolean = baz(::foo) + val b1: Int = baz(::foo) + val b2: String = baz(::foo) + val b3: Boolean = baz(::foo) } diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/resolutionWithGenericCallable.kt b/compiler/testData/diagnostics/tests/callableReference/generic/resolutionWithGenericCallable.kt index 700b918ac7a..38ea1c51932 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/resolutionWithGenericCallable.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/resolutionWithGenericCallable.kt @@ -4,9 +4,9 @@ fun test() { val a1: Array Double> = arrayOf(Double::plus, Double::minus) val a2: Array Double> = arrayOf(Double::plus, Double::minus) - val a3: Array Double> = arrayOf(Double::plus, Double::minus) - val a4: Array Double> = arrayOf(Int::plus, Double::minus) - val a5: Array Double> = arrayOf(Double::plus, Int::minus) + val a3: Array Double> = arrayOf(Double::plus, Double::minus) + val a4: Array Double> = arrayOf(Int::plus, Double::minus) + val a5: Array Double> = arrayOf(Double::plus, Int::minus) } fun foo(x: Int) {} @@ -17,5 +17,5 @@ fun bar(x: T, f: (T) -> Unit) {} fun test2() { bar(1, ::foo) bar("", ::foo) - bar(1.0, ::foo) + bar(1.0, ::foo) } diff --git a/compiler/testData/diagnostics/tests/callableReference/kt34314.kt b/compiler/testData/diagnostics/tests/callableReference/kt34314.kt index 313a17415a1..6a5db993ac9 100644 --- a/compiler/testData/diagnostics/tests/callableReference/kt34314.kt +++ b/compiler/testData/diagnostics/tests/callableReference/kt34314.kt @@ -1,5 +1,5 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE fun main() { - val x = run { ::run } // no error + val x = run { ::run } // no error } diff --git a/compiler/testData/diagnostics/tests/callableReference/kt34314_lambda.kt b/compiler/testData/diagnostics/tests/callableReference/kt34314_lambda.kt index 79128e96b1b..b5756897634 100644 --- a/compiler/testData/diagnostics/tests/callableReference/kt34314_lambda.kt +++ b/compiler/testData/diagnostics/tests/callableReference/kt34314_lambda.kt @@ -3,5 +3,5 @@ fun materialize(): T = TODO() fun main() { - val x = run { materialize() } + val x = run { materialize() } } diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/byGenericArgType.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/byGenericArgType.kt index 235b087b7f7..024574324f4 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/byGenericArgType.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/byGenericArgType.kt @@ -7,4 +7,4 @@ fun foo(s: String) {} val x1 = ofType<() -> Unit>(::foo) val x2 = ofType<(String) -> Unit>(::foo) -val x3 = ofType<(Int) -> Unit>(::foo) +val x3 = ofType<(Int) -> Unit>(::foo) diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/intersectionTypeOverloadWithWrongParameter.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/intersectionTypeOverloadWithWrongParameter.kt index 96d6a5a58df..88eb11bc693 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/intersectionTypeOverloadWithWrongParameter.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/intersectionTypeOverloadWithWrongParameter.kt @@ -10,7 +10,7 @@ class Foo { } fun foo() { - installRoute(::route) + installRoute(::route) } } diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/withGenericFun.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/withGenericFun.kt index 372ea53c07e..8b617f86aa8 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/withGenericFun.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/withGenericFun.kt @@ -8,4 +8,4 @@ fun foo(s: String) {} val x1 = apply(1, ::foo) val x2 = apply("hello", ::foo) -val x3 = apply(true, ::foo) +val x3 = apply(true, ::foo) diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/withPlaceholderTypes.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/withPlaceholderTypes.kt index f65d7a52752..4f7067e2012 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/withPlaceholderTypes.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/withPlaceholderTypes.kt @@ -21,7 +21,7 @@ val x1 = fn1(1, ::foo, ::foo) val x2 = fn1(1, ::foo, ::bar) val x3 = fn2(::bar, ::foo) -val x4 = fn2(::foo, ::bar) -val x5 = fn2(::foo, ::foo) +val x4 = fn2(::foo, ::bar) +val x5 = fn2(::foo, ::foo) val x6 = fn3(1, ::qux) diff --git a/compiler/testData/diagnostics/tests/cast/AsInBlockWithReturnType.kt b/compiler/testData/diagnostics/tests/cast/AsInBlockWithReturnType.kt index 3f049b5d0aa..8c77793e23e 100644 --- a/compiler/testData/diagnostics/tests/cast/AsInBlockWithReturnType.kt +++ b/compiler/testData/diagnostics/tests/cast/AsInBlockWithReturnType.kt @@ -5,7 +5,7 @@ fun runWithoutReturn(r: () -> Unit) = r() fun testRun() { run { 1 as Any - 1 as Any + 1 as Any } run { @@ -16,11 +16,11 @@ fun testRun() { fun foo(): Int = 1 run { - foo() as Any + foo() as Any } run { - (if (true) 1 else 2) as Any + (if (true) 1 else 2) as Any } run { @@ -35,17 +35,17 @@ fun testRun() { } fun testReturn(): Number { - run { 1 as Number } + run { 1 as Number } return run { 1 as Number } } fun testDependent() { listOf(1).map { it as Any - it as Any + it as Any } - listOf().map { it as Any? } + listOf().map { it as Any? } } fun listOf(vararg elements: T): List = TODO() diff --git a/compiler/testData/diagnostics/tests/cast/UselessSafeCast.kt b/compiler/testData/diagnostics/tests/cast/UselessSafeCast.kt index 17d4d6122c7..778a3b5be71 100644 --- a/compiler/testData/diagnostics/tests/cast/UselessSafeCast.kt +++ b/compiler/testData/diagnostics/tests/cast/UselessSafeCast.kt @@ -10,7 +10,7 @@ fun test(x: Int?) { val a7: Number? = 1 as? Number run { x as? Int } - run { x as? Number } + run { x as? Number } foo(x as? Number) diff --git a/compiler/testData/diagnostics/tests/cast/kt15161.kt b/compiler/testData/diagnostics/tests/cast/kt15161.kt index e9ffbb9a7fb..597d3c60953 100644 --- a/compiler/testData/diagnostics/tests/cast/kt15161.kt +++ b/compiler/testData/diagnostics/tests/cast/kt15161.kt @@ -1,6 +1,6 @@ class Array(e: E) { val k = Array(1) { 1 as Any - e as Any? + e as Any? } } diff --git a/compiler/testData/diagnostics/tests/checkArguments/SpreadVarargs.kt b/compiler/testData/diagnostics/tests/checkArguments/SpreadVarargs.kt index e8341da1a8d..66d6e41d1a5 100644 --- a/compiler/testData/diagnostics/tests/checkArguments/SpreadVarargs.kt +++ b/compiler/testData/diagnostics/tests/checkArguments/SpreadVarargs.kt @@ -43,10 +43,10 @@ fun main() { joinG(1, "2") joinG(*1, "2") - joinG(1, *"2") + joinG(1, *"2") joinG(x = 1, a = a) - joinG(x = 1, a = "2") - joinG(x = *1, a = *"2") + joinG(x = 1, a = "2") + joinG(x = *1, a = *"2") joinG(1, *a) joinG(1, *a, "3") joinG(1, "4", *a, "3") diff --git a/compiler/testData/diagnostics/tests/checkArguments/arrayAccessSetTooManyArgs.kt b/compiler/testData/diagnostics/tests/checkArguments/arrayAccessSetTooManyArgs.kt index 812b9bcf085..0625de65475 100644 --- a/compiler/testData/diagnostics/tests/checkArguments/arrayAccessSetTooManyArgs.kt +++ b/compiler/testData/diagnostics/tests/checkArguments/arrayAccessSetTooManyArgs.kt @@ -5,6 +5,6 @@ class A { operator fun set(x: String, value: Int) {} fun d(x: Int) { - this["", 1] = 1 + this["", 1] = 1 } } diff --git a/compiler/testData/diagnostics/tests/checkArguments/kt1897_diagnostic_part.kt b/compiler/testData/diagnostics/tests/checkArguments/kt1897_diagnostic_part.kt index 70ed46339a7..7923405f85b 100644 --- a/compiler/testData/diagnostics/tests/checkArguments/kt1897_diagnostic_part.kt +++ b/compiler/testData/diagnostics/tests/checkArguments/kt1897_diagnostic_part.kt @@ -20,7 +20,7 @@ fun test() { foo("", s = 2) - foo(i = "", s = 2, 33) + foo(i = "", s = 2, 33) foo("", 1) {} diff --git a/compiler/testData/diagnostics/tests/checkArguments/overloadedFunction.kt b/compiler/testData/diagnostics/tests/checkArguments/overloadedFunction.kt index e55a5893fd7..c1b0b78e88d 100644 --- a/compiler/testData/diagnostics/tests/checkArguments/overloadedFunction.kt +++ b/compiler/testData/diagnostics/tests/checkArguments/overloadedFunction.kt @@ -11,6 +11,6 @@ fun test() { foo(1, 2) foo("") - bar(1, 2) + bar(1, 2) bar() } diff --git a/compiler/testData/diagnostics/tests/checkType.kt b/compiler/testData/diagnostics/tests/checkType.kt index 7940dd064f5..03dc66e2976 100644 --- a/compiler/testData/diagnostics/tests/checkType.kt +++ b/compiler/testData/diagnostics/tests/checkType.kt @@ -6,6 +6,6 @@ interface C : B fun test(b: B) { b checkType { _() } - b checkType { _() } - b checkType { _() } + b checkType { _() } + b checkType { _() } } diff --git a/compiler/testData/diagnostics/tests/collectionLiterals/argumentsOfAnnotation.kt b/compiler/testData/diagnostics/tests/collectionLiterals/argumentsOfAnnotation.kt index 4936d9c51cd..b6e772598f0 100644 --- a/compiler/testData/diagnostics/tests/collectionLiterals/argumentsOfAnnotation.kt +++ b/compiler/testData/diagnostics/tests/collectionLiterals/argumentsOfAnnotation.kt @@ -8,7 +8,7 @@ fun test1() {} @Foo([], [], []) fun test2() {} -@Foo([1f], [' '], [1]) +@Foo([1f], [' '], [1]) fun test3() {} @Foo(c = [1f], b = [""], a = [1]) diff --git a/compiler/testData/diagnostics/tests/collectionLiterals/argumentsOfAnnotationWithKClass.kt b/compiler/testData/diagnostics/tests/collectionLiterals/argumentsOfAnnotationWithKClass.kt index 5342e7a0cbb..10fc6a66ae5 100644 --- a/compiler/testData/diagnostics/tests/collectionLiterals/argumentsOfAnnotationWithKClass.kt +++ b/compiler/testData/diagnostics/tests/collectionLiterals/argumentsOfAnnotationWithKClass.kt @@ -20,10 +20,10 @@ fun test3() {} @Foo([Gen::class]) fun test4() {} -@Foo([""]) +@Foo([""]) fun test5() {} -@Foo([Int::class, 1]) +@Foo([Int::class, 1]) fun test6() {} @Bar diff --git a/compiler/testData/diagnostics/tests/collectionLiterals/basicCollectionLiterals.kt b/compiler/testData/diagnostics/tests/collectionLiterals/basicCollectionLiterals.kt index eeec3c94baf..ec3b26925e1 100644 --- a/compiler/testData/diagnostics/tests/collectionLiterals/basicCollectionLiterals.kt +++ b/compiler/testData/diagnostics/tests/collectionLiterals/basicCollectionLiterals.kt @@ -2,11 +2,11 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE, -UNSUPPORTED fun test() { - val a = [] + val a = [] val b: Array = [] val c = [1, 2] val d: Array = [1, 2] - val e: Array = [1] + val e: Array = [1] val f: IntArray = [1, 2] val g = [f] @@ -19,5 +19,5 @@ fun check() { val f: IntArray = [1] [f] checkType { _>() } - [1, ""] checkType { _>() } + [1, ""] checkType { _>() } } diff --git a/compiler/testData/diagnostics/tests/collectionLiterals/collectionLiteralsWithVarargs.kt b/compiler/testData/diagnostics/tests/collectionLiterals/collectionLiteralsWithVarargs.kt index 24e9f0ac5fb..a19abc9c0bc 100644 --- a/compiler/testData/diagnostics/tests/collectionLiterals/collectionLiteralsWithVarargs.kt +++ b/compiler/testData/diagnostics/tests/collectionLiterals/collectionLiteralsWithVarargs.kt @@ -16,7 +16,7 @@ fun test1_0() {} @Ann1(*["a", "b"]) fun test1_1() {} -@Ann1(*["a", 1, null]) +@Ann1(*["a", 1, null]) fun test1_2() {} @Ann2(*[]) @@ -33,8 +33,8 @@ fun test6() {} annotation class AnnArray(val a: Array) -@AnnArray(*["/"]) +@AnnArray(*["/"]) fun testArray() {} -@Ann1([""]) +@Ann1([""]) fun testVararg() {} diff --git a/compiler/testData/diagnostics/tests/collectionLiterals/defaultValuesInAnnotation.kt b/compiler/testData/diagnostics/tests/collectionLiterals/defaultValuesInAnnotation.kt index e5e96268466..882d362e46c 100644 --- a/compiler/testData/diagnostics/tests/collectionLiterals/defaultValuesInAnnotation.kt +++ b/compiler/testData/diagnostics/tests/collectionLiterals/defaultValuesInAnnotation.kt @@ -7,9 +7,9 @@ annotation class Foo( ) annotation class Bar( - val a: Array = [' '], - val b: Array = ["", ''], - val c: Array = [1] + val a: Array = [' '], + val b: Array = ["", ''], + val c: Array = [1] ) annotation class Base( @@ -21,5 +21,5 @@ annotation class Base( annotation class Err( val a: IntArray = [1L], - val b: Array = [1] + val b: Array = [1] ) diff --git a/compiler/testData/diagnostics/tests/collectionLiterals/noCollectionLiterals.kt b/compiler/testData/diagnostics/tests/collectionLiterals/noCollectionLiterals.kt index 5dbd20eebac..38bbf86fcc5 100644 --- a/compiler/testData/diagnostics/tests/collectionLiterals/noCollectionLiterals.kt +++ b/compiler/testData/diagnostics/tests/collectionLiterals/noCollectionLiterals.kt @@ -5,7 +5,7 @@ fun test(): Array { foo([""]) - val p = [1, 2] + [3, 4] + val p = [1, 2] + [3, 4] return [1, 2] } diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/UninitializedOrReassignedVariables.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/UninitializedOrReassignedVariables.kt index 1c98b0be80a..354d78c5cc7 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/UninitializedOrReassignedVariables.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/UninitializedOrReassignedVariables.kt @@ -240,7 +240,7 @@ class Outer() { } class ForwardAccessToBackingField() { //kt-147 - val a = a // error + val a = a // error val b = c // error val c = 1 } diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/elvisNotProcessed.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/elvisNotProcessed.kt index fc05d4b0315..0477ba5ce3c 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/elvisNotProcessed.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/elvisNotProcessed.kt @@ -11,16 +11,16 @@ else { } val ww = if (true) { - { true } ?: null!! + { true } ?: null!! } else if (true) { - { true } ?: null!! + { true } ?: null!! } else { null!! } -val n = null ?: (null ?: { true }) +val n = null ?: (null ?: { true }) fun l(): (() -> Boolean)? = null @@ -33,6 +33,6 @@ val bbb = null ?: ( l() ?: null) val bbbb = ( l() ?: null) ?: ( l() ?: null) fun f(x : Long?): Long { - var a = x ?: (fun() {} ?: fun() {}) - return a + var a = x ?: (fun() {} ?: fun() {}) + return a } diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt10805.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt10805.kt index d4e35c0e1a2..a3d63d00812 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt10805.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt10805.kt @@ -1,11 +1,11 @@ // AssertionError for nested ifs with lambdas and Nothing as results // NI_EXPECTED_FILE -val fn = if (true) { - { true } -} +val fn = if (true) { + { true } +} else if (true) { - { true } + { true } } else { null!! diff --git a/compiler/testData/diagnostics/tests/controlStructures/ifElseIntersection.kt b/compiler/testData/diagnostics/tests/controlStructures/ifElseIntersection.kt index f392a3bf95f..f8df0a7174a 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/ifElseIntersection.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/ifElseIntersection.kt @@ -8,7 +8,7 @@ class None : Option fun bind(r: Option): Option { return if (r is Some) { // Ideally we should infer Option here (see KT-10896) - (if (true) None() else r) checkType { _>() } + (if (true) None() else r) checkType { _>() } // Works correctly if (true) None() else r } @@ -24,9 +24,9 @@ fun bind2(r: Option): Option { } fun bind3(r: Option): Option { - return if (r is Some) { + return if (r is Some) { // Diagnoses an error correctly - if (true) None() else r + if (true) None() else r } else r } diff --git a/compiler/testData/diagnostics/tests/controlStructures/ifInResultOfLambda.kt b/compiler/testData/diagnostics/tests/controlStructures/ifInResultOfLambda.kt index 8730c503721..08d46d81584 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/ifInResultOfLambda.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/ifInResultOfLambda.kt @@ -1,8 +1,8 @@ // NI_EXPECTED_FILE -val test1 = { if (true) 1 else "" } +val test1 = { if (true) 1 else "" } -val test2 = { { if (true) 1 else "" } } +val test2 = { { if (true) 1 else "" } } val test3: (Boolean) -> Any = { if (it) 1 else "" } diff --git a/compiler/testData/diagnostics/tests/controlStructures/ifToAnyDiscriminatingUsages.kt b/compiler/testData/diagnostics/tests/controlStructures/ifToAnyDiscriminatingUsages.kt index 0d77713af4f..5df8b01b997 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/ifToAnyDiscriminatingUsages.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/ifToAnyDiscriminatingUsages.kt @@ -16,8 +16,8 @@ fun testResultOfLambda2() = fun testResultOfAnonFun1() = run(fun () = - if (true) 42 - else println() + if (true) 42 + else println() ) fun testResultOfAnonFun2() = @@ -27,7 +27,7 @@ fun testResultOfAnonFun2() = fun testReturnFromAnonFun() = run(fun () { - return if (true) 42 else println() + return if (true) 42 else println() }) fun testReturn1() = diff --git a/compiler/testData/diagnostics/tests/controlStructures/ifWhenWithoutElse.kt b/compiler/testData/diagnostics/tests/controlStructures/ifWhenWithoutElse.kt index 9a03f5e5193..29b41b366ca 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/ifWhenWithoutElse.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/ifWhenWithoutElse.kt @@ -19,10 +19,10 @@ val xx6 = null ?: if (true) 42 val xx7 = "" + if (true) 42 val wxx1 = when { true -> 42 } -val wxx2: Unit = when { true -> 42 } +val wxx2: Unit = when { true -> 42 } val wxx3 = idAny(when { true -> 42 }) val wxx4 = id(when { true -> 42 }) -val wxx5 = idUnit(when { true -> 42 }) +val wxx5 = idUnit(when { true -> 42 }) val wxx6 = null ?: when { true -> 42 } val wxx7 = "" + when { true -> 42 } @@ -50,8 +50,8 @@ fun g1() = when { true -> work() } fun g2() = when { true -> mlist.add() } fun g3() = when { true -> 42 } fun g4(): Unit = when { true -> work() } -fun g5(): Unit = when { true -> mlist.add() } -fun g6(): Unit = when { true -> 42 } +fun g5(): Unit = when { true -> mlist.add() } +fun g6(): Unit = when { true -> 42 } fun foo1(x: String?) { "" + if (true) 42 diff --git a/compiler/testData/diagnostics/tests/controlStructures/improperElseInExpression.kt b/compiler/testData/diagnostics/tests/controlStructures/improperElseInExpression.kt index 87f5433a10c..b33d2230459 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/improperElseInExpression.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/improperElseInExpression.kt @@ -29,5 +29,5 @@ fun example() { return if (true) true } - return if (true) true else {} + return if (true) true else {} } diff --git a/compiler/testData/diagnostics/tests/controlStructures/kt1075.kt b/compiler/testData/diagnostics/tests/controlStructures/kt1075.kt index 99514c908c0..c0d959540cc 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/kt1075.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/kt1075.kt @@ -4,7 +4,7 @@ package kt1075 fun foo(b: String) { if (b in 1..10) {} //type mismatch - when (b) { + when (b) { in 1..10 -> 1 //no type mismatch, but it should be here else -> 2 } diff --git a/compiler/testData/diagnostics/tests/controlStructures/kt4310.kt b/compiler/testData/diagnostics/tests/controlStructures/kt4310.kt index 6cedf388b3c..75ed1d06bbd 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/kt4310.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/kt4310.kt @@ -3,9 +3,9 @@ package f fun test(a: Boolean, b: Boolean): Int { return if(a) { 1 - } else { - if (b) { + } else { + if (b) { 3 - } + } } } diff --git a/compiler/testData/diagnostics/tests/controlStructures/kt770.kt351.kt735_StatementType.kt b/compiler/testData/diagnostics/tests/controlStructures/kt770.kt351.kt735_StatementType.kt index a64a5ada2dc..a01825b54f5 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/kt770.kt351.kt735_StatementType.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/kt770.kt351.kt735_StatementType.kt @@ -104,8 +104,8 @@ fun testImplicitCoercion() { val g = if (true) 4 val h = if (false) 4 else {} - bar(if (true) { - 4 + bar(if (true) { + 4 } else { z = 342 }) diff --git a/compiler/testData/diagnostics/tests/controlStructures/lambdasInExclExclAndElvis.kt b/compiler/testData/diagnostics/tests/controlStructures/lambdasInExclExclAndElvis.kt index 10ee29495d2..0a7e678e8d7 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/lambdasInExclExclAndElvis.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/lambdasInExclExclAndElvis.kt @@ -7,9 +7,9 @@ fun test() { use({ }!!); // KT-KT-9070 - { } ?: 1 + { } ?: 1 use({ 2 } ?: 1); - 1 ?: { } + 1 ?: { } use(1 ?: { }) } diff --git a/compiler/testData/diagnostics/tests/controlStructures/tryReturnType.kt b/compiler/testData/diagnostics/tests/controlStructures/tryReturnType.kt index cbc3c9ad178..26175985a2e 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/tryReturnType.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/tryReturnType.kt @@ -13,11 +13,11 @@ fun foo() : Int { } fun bar() : Int = - try { - doSmth() + try { + doSmth() } - catch (e: Exception) { - "" + catch (e: Exception) { + "" } finally { "" diff --git a/compiler/testData/diagnostics/tests/controlStructures/typeInferenceForExclExcl.kt b/compiler/testData/diagnostics/tests/controlStructures/typeInferenceForExclExcl.kt index 1a88b9283b5..d6142bae636 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/typeInferenceForExclExcl.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/typeInferenceForExclExcl.kt @@ -12,9 +12,9 @@ fun exclExcl(t: T?): T = t!! fun test11() { // not 'String!' exclExcl(A.foo()) checkType { _() } - exclExcl(A.foo()) checkType { _() } + exclExcl(A.foo()) checkType { _() } // not 'String!' A.foo()!! checkType { _() } - A.foo()!! checkType { _() } + A.foo()!! checkType { _() } } diff --git a/compiler/testData/diagnostics/tests/controlStructures/whenInResultOfLambda.kt b/compiler/testData/diagnostics/tests/controlStructures/whenInResultOfLambda.kt index cdd6da5d9fb..6091bb406eb 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/whenInResultOfLambda.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/whenInResultOfLambda.kt @@ -1,8 +1,8 @@ // NI_EXPECTED_FILE -val test1 = { when (true) { true -> 1; else -> "" } } +val test1 = { when (true) { true -> 1; else -> "" } } -val test2 = { { when (true) { true -> 1; else -> "" } } } +val test2 = { { when (true) { true -> 1; else -> "" } } } val test3: (Boolean) -> Any = { when (true) { true -> 1; else -> "" } } diff --git a/compiler/testData/diagnostics/tests/dataClasses/extensionComponentsOnNullable.kt b/compiler/testData/diagnostics/tests/dataClasses/extensionComponentsOnNullable.kt index 04aa688f891..db2869f18fe 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/extensionComponentsOnNullable.kt +++ b/compiler/testData/diagnostics/tests/dataClasses/extensionComponentsOnNullable.kt @@ -8,7 +8,7 @@ fun foo(): Int { val d: Data? = null // An error must be here val (x, y) = d - return x + y + return x + y } data class NormalData(val x: T, val y: T) @@ -17,5 +17,5 @@ fun bar(): Int { val d: NormalData? = null // An error must be here val (x, y) = d - return x + y + return x + y } diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/BinaryExpression.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/BinaryExpression.kt index c0375b26d1e..3dfed6e6691 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/BinaryExpression.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/BinaryExpression.kt @@ -5,6 +5,6 @@ fun foo() { val x: Int? = null bar(1 + (if (x == null) 0 else x)) - bar(if (x == null) x else x) + bar(if (x == null) x else x) if (x != null) bar(x + x/(x-x*x)) } diff --git a/compiler/testData/diagnostics/tests/declarationChecks/MultiDeclarationErrors.kt b/compiler/testData/diagnostics/tests/declarationChecks/MultiDeclarationErrors.kt index bcaab066105..a756abf6064 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/MultiDeclarationErrors.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/MultiDeclarationErrors.kt @@ -11,7 +11,7 @@ class MyClass2 {} fun test(mc1: MyClass, mc2: MyClass2) { val (a, b) = mc1 - val (c) = mc2 + val (c) = mc2 //a,b,c are error types use(a, b, c) diff --git a/compiler/testData/diagnostics/tests/declarationChecks/localVariablesWithTypeParameters_1_3.kt b/compiler/testData/diagnostics/tests/declarationChecks/localVariablesWithTypeParameters_1_3.kt index 34bf432c684..3d53bcdcdcf 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/localVariablesWithTypeParameters_1_3.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/localVariablesWithTypeParameters_1_3.kt @@ -10,7 +10,7 @@ fun test() { const val a3 = 0 lateinit val a4 = 0 val a5 by Delegate() - val a6 by Delegate<T>() + val a6 by Delegate<T>() } class Delegate { diff --git a/compiler/testData/diagnostics/tests/declarationChecks/localVariablesWithTypeParameters_1_4.kt b/compiler/testData/diagnostics/tests/declarationChecks/localVariablesWithTypeParameters_1_4.kt index c6349bf1758..02a1d91495f 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/localVariablesWithTypeParameters_1_4.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/localVariablesWithTypeParameters_1_4.kt @@ -10,7 +10,7 @@ fun test() { const val a3 = 0 lateinit val a4 = 0 val a5 by Delegate() - val a6 by Delegate<T>() + val a6 by Delegate<T>() } class Delegate { diff --git a/compiler/testData/diagnostics/tests/declarationChecks/namedFunAsLastExpressionInBlock.kt b/compiler/testData/diagnostics/tests/declarationChecks/namedFunAsLastExpressionInBlock.kt index 52a7add926a..8db8fecf91c 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/namedFunAsLastExpressionInBlock.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/namedFunAsLastExpressionInBlock.kt @@ -6,8 +6,8 @@ fun test() { val x = fun named1(x: Int): Int { return 1 } x checkType { _>() } - foo { Int")!>fun named2(): Int {return 1} } - foo({ fun named3() = 1 }) + foo { Int")!>fun named2(): Int {return 1} } + foo({ fun named3() = 1 }) val x1 = if (1 == 1) @@ -26,15 +26,15 @@ fun test() { fun named7() = 1 val x3 = when (1) { - 0 -> fun named8(): Int {return 1} - else -> fun named9() = 1 + 0 -> fun named8(): Int {return 1} + else -> fun named9() = 1 } val x31 = when (1) { 0 -> { - fun named10(): Int {return 1} + fun named10(): Int {return 1} } - else -> fun named11() = 1 + else -> fun named11() = 1 } val x4 = { @@ -64,11 +64,11 @@ fun success() { val y = when (1) { 0 -> { - fun named4(): Int {return 1} + fun named4(): Int {return 1} } else -> { - fun named5(): Int {return 1} + fun named5(): Int {return 1} } } - y checkType { _() } + y checkType { _() } } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.kt index 0783efd2d35..f938bcafd34 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.kt @@ -9,10 +9,10 @@ class A(outer: Outer) { var g: String by outer.getContainer().getMyProperty() - var b: String by foo(getMyProperty()) - var r: String by foo(outer.getContainer().getMyProperty()) - var e: String by + foo(getMyProperty()) - var f: String by foo(getMyProperty()) - 1 + var b: String by foo(getMyProperty()) + var r: String by foo(outer.getContainer().getMyProperty()) + var e: String by + foo(getMyProperty()) + var f: String by foo(getMyProperty()) - 1 } fun foo(a: Any?) = MyProperty() diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionProperty.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionProperty.kt index 0eaf8779c39..b2dffbb0989 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionProperty.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionProperty.kt @@ -3,10 +3,10 @@ package foo import kotlin.reflect.KProperty open class A { - val B.w: Int by MyProperty() + val B.w: Int by MyProperty() } -val B.r: Int by MyProperty() +val B.r: Int by MyProperty() val A.e: Int by MyProperty() diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethodInGenericClass.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethodInGenericClass.kt index f18f53b6e64..462d4c0511f 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethodInGenericClass.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethodInGenericClass.kt @@ -7,7 +7,7 @@ class A() { operator fun setValue(t: Any?, p: KProperty<*>, x: T) = Unit } -var a1: Int by A() +var a1: Int by A() var a2: Int by A() class B() { @@ -24,4 +24,4 @@ class C() { } var c1: Int by C() -var c2: Int by C() +var c2: Int by C() diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/manyIncompleteCandidates.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/manyIncompleteCandidates.kt index 171f126cf43..1e9bfcf10c3 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/manyIncompleteCandidates.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/manyIncompleteCandidates.kt @@ -4,7 +4,7 @@ package test import first.* import second.* -val a12 by A() +val a12 by A() // FILE: first.kt package first diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/noErrorsForImplicitConstraints.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/noErrorsForImplicitConstraints.kt index 7567a02eeee..68c0eb2d53d 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/noErrorsForImplicitConstraints.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/noErrorsForImplicitConstraints.kt @@ -3,8 +3,8 @@ package foo import kotlin.reflect.KProperty class A { - var a5: String by MyProperty1() - var b5: String by getMyProperty1() + var a5: String by MyProperty1() + var b5: String by getMyProperty1() } fun getMyProperty1() = MyProperty1() @@ -23,8 +23,8 @@ class MyProperty1 { // ----------------- class B { - var a5: String by MyProperty2() - var b5: String by getMyProperty2() + var a5: String by MyProperty2() + var b5: String by getMyProperty2() } fun getMyProperty2() = MyProperty2() diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/noExpectedTypeForSupertypeConstraint.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/noExpectedTypeForSupertypeConstraint.kt index 03e73314c98..e170ab23d91 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/noExpectedTypeForSupertypeConstraint.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/noExpectedTypeForSupertypeConstraint.kt @@ -2,7 +2,7 @@ import kotlin.reflect.KProperty class A { - var a by MyProperty() + var a by MyProperty() } class MyProperty { diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/propertyDefferedType.kt b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDefferedType.kt index 48a0d8f191f..0acf51ee29d 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/propertyDefferedType.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDefferedType.kt @@ -4,7 +4,7 @@ import kotlin.reflect.KProperty class B { - val c by Delegate(ag) + val c by Delegate(ag) } class Delegate(val init: T) { diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/commonCaseForInference.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/commonCaseForInference.kt index 96abfb0a2ea..939dc591ccf 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/commonCaseForInference.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/commonCaseForInference.kt @@ -8,6 +8,6 @@ object CommonCase { operator fun Fas.provideDelegate(host: D, p: Any?): Fas = TODO() operator fun Fas.getValue(receiver: E, p: Any?): R = TODO() - val Long.test1: String by delegate() // common test, not working because of Inference1 + val Long.test1: String by delegate() // common test, not working because of Inference1 val Long.test2: String by delegate() // should work } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver2.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver2.kt index 912cbd332ce..88fd51b3f3b 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver2.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver2.kt @@ -9,5 +9,5 @@ object T2 { operator fun Foo.getValue(receiver: String, p: Any?): T = TODO() val String.test1: String by delegate() - val test2: String by delegate() + val test2: String by delegate() } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/inferenceFromReceiver1.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/inferenceFromReceiver1.kt index 3307d9547ca..5732f1daa4e 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/inferenceFromReceiver1.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/inferenceFromReceiver1.kt @@ -8,7 +8,7 @@ object Inference1 { operator fun Foo.getValue(receiver: T, p: Any?): String = TODO() // not working because resulting descriptor for getValue contains type `???` instead of `T` - val test1: String by delegate() + val test1: String by delegate() val test2: String by delegate() } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/inferenceFromReceiver2.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/inferenceFromReceiver2.kt index 751afebbaa8..b7e181b7a47 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/inferenceFromReceiver2.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/inferenceFromReceiver2.kt @@ -8,6 +8,6 @@ object Inference2 { operator fun Foo.provideDelegate(host: T, p: Any?): Foo = TODO() operator fun Foo.getValue(receiver: Inference2, p: Any?): String = TODO() - val test1: String by delegate() // same story like in Inference1 + val test1: String by delegate() // same story like in Inference1 val test2: String by delegate() } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/noOperatorModifierOnProvideDelegate.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/noOperatorModifierOnProvideDelegate.kt index 4e036de80a9..d92e6ab8bf5 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/noOperatorModifierOnProvideDelegate.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/noOperatorModifierOnProvideDelegate.kt @@ -12,6 +12,5 @@ fun String.provideDelegate(a: Any?, p: KProperty<*>) = StringDelegate(this) operator fun String.getValue(a: Any?, p: KProperty<*>) = this val test1: String by "OK" -val test2: Int by "OK" +val test2: Int by "OK" val test3 by "OK" - diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/setValue.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/setValue.kt index 1e52379b53e..c0c565e46d8 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/setValue.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/setValue.kt @@ -7,10 +7,10 @@ operator fun Delegate.setValue(receiver: Any?, p: Any, value: T) {} operator fun String.provideDelegate(receiver: Any?, p: Any) = Delegate() -var test1: String by Delegate() +var test1: String by Delegate() var test2: String by Delegate() var test3: String by "OK" -var test4: String by "OK".provideDelegate(null, "") +var test4: String by "OK".provideDelegate(null, "") var test5: String by "OK".provideDelegate(null, "") diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/unsupportedOperatorProvideDelegate.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/unsupportedOperatorProvideDelegate.kt index 9028f3f8d0d..e92730fa924 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/unsupportedOperatorProvideDelegate.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/unsupportedOperatorProvideDelegate.kt @@ -10,5 +10,5 @@ class WrongDelegate(val x: Int) { operator fun String.getValue(thisRef: Any?, prop: Any) = this val test1: String by "OK" -val test2: Int by "OK" +val test2: Int by "OK" val test3 by "OK" diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/recursiveType.kt b/compiler/testData/diagnostics/tests/delegatedProperty/recursiveType.kt index 256d2a421d8..39286ef1ed3 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/recursiveType.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/recursiveType.kt @@ -3,12 +3,12 @@ import kotlin.reflect.KProperty -val a by a +val a by a -val b by Delegate(b) +val b by Delegate(b) val c by d -val d by c +val d by c class Delegate(i: Int) { operator fun getValue(t: Any?, p: KProperty<*>): Int { diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetReturnType.kt b/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetReturnType.kt index 740a7d7176c..babcd067eb8 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetReturnType.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetReturnType.kt @@ -2,7 +2,7 @@ import kotlin.reflect.KProperty -val c: Int by Delegate() +val c: Int by Delegate() class Delegate { operator fun getValue(t: Any?, p: KProperty<*>): String { diff --git a/compiler/testData/diagnostics/tests/delegation/DelegationExpectedType.kt b/compiler/testData/diagnostics/tests/delegation/DelegationExpectedType.kt index 3a7baea34f5..c8c38aaab90 100644 --- a/compiler/testData/diagnostics/tests/delegation/DelegationExpectedType.kt +++ b/compiler/testData/diagnostics/tests/delegation/DelegationExpectedType.kt @@ -20,6 +20,6 @@ class D : A by baz({ it + 1 }) fun boo(t: T): A = AImpl() -class E : A by boo("") +class E : A by boo("") class F : A by AImpl() diff --git a/compiler/testData/diagnostics/tests/enum/kt8972_cloneNotAllowed.kt b/compiler/testData/diagnostics/tests/enum/kt8972_cloneNotAllowed.kt index f18c3eb226b..1ab97b44123 100644 --- a/compiler/testData/diagnostics/tests/enum/kt8972_cloneNotAllowed.kt +++ b/compiler/testData/diagnostics/tests/enum/kt8972_cloneNotAllowed.kt @@ -1,6 +1,6 @@ enum class E : Cloneable { A; override fun clone(): Any { - return super.clone() + return super.clone() } } diff --git a/compiler/testData/diagnostics/tests/extensions/ExtensionFunctions.kt b/compiler/testData/diagnostics/tests/extensions/ExtensionFunctions.kt index 9d66173da70..507b6089e85 100644 --- a/compiler/testData/diagnostics/tests/extensions/ExtensionFunctions.kt +++ b/compiler/testData/diagnostics/tests/extensions/ExtensionFunctions.kt @@ -19,7 +19,7 @@ class A infix operator fun A.plus(a : Any) { 1.foo() - true.foo() + true.foo() 1 } diff --git a/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver.kt b/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver.kt index 28e12d062f2..2f33108dfb3 100644 --- a/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver.kt +++ b/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver.kt @@ -34,22 +34,22 @@ fun test4() { // should be an error on receiver, shouldn't be thrown away fun test5() { - 1.(fun String.()=1)() + 1.(fun String.()=1)() } fun R?.sure() : R = this!! fun test6(l: List?) { - l.sure<T>() + l.sure() } fun List.b() {} fun test7(l: List) { - l.b() + l.b() } fun test8(l: List?) { - l.b() + l.b() } diff --git a/compiler/testData/diagnostics/tests/functionAsExpression/InferenceParametersTypes.kt b/compiler/testData/diagnostics/tests/functionAsExpression/InferenceParametersTypes.kt index e810eadd259..ca82f561e4c 100644 --- a/compiler/testData/diagnostics/tests/functionAsExpression/InferenceParametersTypes.kt +++ b/compiler/testData/diagnostics/tests/functionAsExpression/InferenceParametersTypes.kt @@ -11,7 +11,7 @@ fun test(a: (Int) -> Int) { } fun test2(a: () -> List) { - test2(fun () = listOf()) + test2(fun () = listOf()) } val a: (Int) -> Unit = fun(x) { checkSubtype(x) } diff --git a/compiler/testData/diagnostics/tests/functionAsExpression/ReceiverByExpectedType.kt b/compiler/testData/diagnostics/tests/functionAsExpression/ReceiverByExpectedType.kt index 97f43096fcc..5e87ac1cb50 100644 --- a/compiler/testData/diagnostics/tests/functionAsExpression/ReceiverByExpectedType.kt +++ b/compiler/testData/diagnostics/tests/functionAsExpression/ReceiverByExpectedType.kt @@ -1,2 +1,2 @@ fun foo(f: String.() -> Int) {} -val test = foo(fun () = length) +val test = foo(fun () = length) diff --git a/compiler/testData/diagnostics/tests/functionAsExpression/WithGenericParameters.kt b/compiler/testData/diagnostics/tests/functionAsExpression/WithGenericParameters.kt index 3209a9efa5d..5e13d0cfe64 100644 --- a/compiler/testData/diagnostics/tests/functionAsExpression/WithGenericParameters.kt +++ b/compiler/testData/diagnostics/tests/functionAsExpression/WithGenericParameters.kt @@ -11,8 +11,8 @@ fun fun_with_where() = fun T.(t: T): T whe fun outer() { devNull(fun () {}) - devNull(fun T.() {}) - devNull(fun (): T = null!!) - devNull(fun (t: T) {}) + devNull(fun T.() {}) + devNull(fun (): T = null!!) + devNull(fun (t: T) {}) devNull(fun () where T:A {}) } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/ExpectedParametersTypesMismatch.kt b/compiler/testData/diagnostics/tests/functionLiterals/ExpectedParametersTypesMismatch.kt index dba678eb05a..93d19bead5d 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/ExpectedParametersTypesMismatch.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/ExpectedParametersTypesMismatch.kt @@ -8,37 +8,37 @@ fun test1() { foo0 { "" } - foo0 { + foo0 { s: String-> "" } - foo0 { + foo0 { x, y -> "" } foo1 { "" } - foo1 { + foo1 { s: String -> "" } - foo1 { + foo1 { x, y -> "" } - foo1 { + foo1 { -> 42 } - foo2 { + foo2 { "" } - foo2 { + foo2 { s: String -> "" } - foo2 { + foo2 { x -> "" } - foo2 { + foo2 { -> 42 } } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/LabeledFunctionLiterals.kt b/compiler/testData/diagnostics/tests/functionLiterals/LabeledFunctionLiterals.kt index 9b020300a14..4bcde82e60e 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/LabeledFunctionLiterals.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/LabeledFunctionLiterals.kt @@ -9,7 +9,7 @@ fun foo(a: A, f: () -> T): T = f() fun foo(b: B, f: () -> T): T = f() fun test(c: C) { - foo(c) f@ { + foo(c) f@ { c!! } } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambdaWithExpectedType.kt b/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambdaWithExpectedType.kt index 27ed62005c0..4b0c8a9308d 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambdaWithExpectedType.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambdaWithExpectedType.kt @@ -11,5 +11,5 @@ fun test(bal: Array) { val e: Unit = run { bar += 4 } - val f: Int = run { bar += 4 } + val f: Int = run { bar += 4 } } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/complexInference.kt b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/complexInference.kt index 7eeff83541d..08a5f4fab19 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/complexInference.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/complexInference.kt @@ -29,10 +29,10 @@ fun bar(aInstance: A, bInstance: B) { d checkType { _() } } - foo(bInstance) { + foo(bInstance) { (a, b), (c, d) -> - a checkType { _() } - b checkType { _() } + a checkType { _() } + b checkType { _() } c checkType { _() } d checkType { _() } } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/inferredFunctionalType.kt b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/inferredFunctionalType.kt index c074bbbc53c..3a44a0c0577 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/inferredFunctionalType.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/inferredFunctionalType.kt @@ -26,8 +26,8 @@ fun bar(aList: List) { b checkType { _() } } - aList.foo { (a, b): B -> - b checkType { _() } - a checkType { _() } + aList.foo { (a, b): B -> + b checkType { _() } + a checkType { _() } } } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/noExpectedType.kt b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/noExpectedType.kt index 5753f8c2c0b..24e5a0a220b 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/noExpectedType.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/noExpectedType.kt @@ -25,7 +25,7 @@ fun bar() { y2 checkType { _<(A) -> Unit>() } val z = { (a: Int, b: String) -> - a checkType { _() } - b checkType { _() } + a checkType { _() } + b checkType { _() } } } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/redeclaration.kt b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/redeclaration.kt index f47c7d525fe..3a53a31943f 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/redeclaration.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/redeclaration.kt @@ -7,23 +7,23 @@ fun foo(block: (A, B) -> Unit) { } fun bar() { foo { (a, a), b -> - a checkType { _() } - b checkType { _() } + a checkType { _() } + b checkType { _() } } foo { (a, b), a -> - a checkType { _() } + a checkType { _() } b checkType { _() } } foo { a, (a, b) -> - a checkType { _() } - b checkType { _() } + a checkType { _() } + b checkType { _() } } foo { (a, b), (c, b) -> a checkType { _() } - b checkType { _() } - c checkType { _() } + b checkType { _() } + c checkType { _() } } } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/simple.kt b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/simple.kt index cfb973869e4..b5c9606fcc9 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/simple.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/simple.kt @@ -46,7 +46,7 @@ fun bar() { b checkType { _() } } - foo { (a, b): B -> + foo { (a, b): B -> a checkType { _() } b checkType { _() } } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/underscore.kt b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/underscore.kt index 585dec4c051..8f37743f60e 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/underscore.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/underscore.kt @@ -7,35 +7,35 @@ fun foo(block: (A) -> Unit) { } fun bar() { foo { (_, b) -> - _.hashCode() + _.hashCode() b checkType { _() } } foo { (a, _) -> a checkType { _() } - _.hashCode() + _.hashCode() } foo { (_, _) -> - _.hashCode() + _.hashCode() } foo { (_: Int, b: String) -> - _.hashCode() + _.hashCode() b checkType { _() } } foo { (a: Int, _: String) -> a checkType { _() } - _.hashCode() + _.hashCode() } foo { (_: Int, _: String) -> - _.hashCode() + _.hashCode() } foo { (_, _): A -> - _.hashCode() + _.hashCode() } foo { (`_`, _) -> @@ -51,12 +51,12 @@ fun bar() { } foo { (_: String, b) -> - _.hashCode() + _.hashCode() b checkType { _() } } - foo { (_, b): B -> - _.hashCode() + foo { (_, b): B -> + _.hashCode() b checkType { _() } } } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/kt7383_starProjectedFunction.kt b/compiler/testData/diagnostics/tests/functionLiterals/kt7383_starProjectedFunction.kt index bf12887292c..54e02ed4d81 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/kt7383_starProjectedFunction.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/kt7383_starProjectedFunction.kt @@ -2,5 +2,5 @@ fun foo() { val f : Function1<*, *> = { x -> x.toString() } - f(1) + f(1) } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/NoCommonSystem.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/NoCommonSystem.kt index 8f97ce3f2f7..e86df822f8d 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/NoCommonSystem.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/NoCommonSystem.kt @@ -5,10 +5,10 @@ fun listOf(vararg values: T): List = null!! fun commonSystemFailed(a: List) { a.map { if (it == 0) return@map listOf(it) - listOf() + listOf() } a.map { - if (it == 0) return@map listOf() + if (it == 0) return@map listOf() listOf(it) } a.map { diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/SmartCast.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/SmartCast.kt index 8bbe3eaec5d..20b2ce0fc8c 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/SmartCast.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/SmartCast.kt @@ -9,7 +9,7 @@ val a /* :(Int?) -> Int? */ = l@ { it: Int? -> // but must be (Int?) -> Int fun let(f: (Int?) -> R): R = null!! val b /*: Int? */ = let { // but must be Int - if (it != null) return@let it + if (it != null) return@let it 5 } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/returnNullWithReturn.kt b/compiler/testData/diagnostics/tests/functionLiterals/returnNullWithReturn.kt index 54199aebc46..966e4961a6f 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/returnNullWithReturn.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/returnNullWithReturn.kt @@ -4,7 +4,7 @@ interface Element fun test(handlers: MapUnit>) { - handlers.getOrElse("name", l@ { return@l null }) + handlers.getOrElse("name", l@ { return@l null }) } fun Map.getOrElse(key: K, defaultValue: ()-> V) : V = throw Exception("$key $defaultValue") diff --git a/compiler/testData/diagnostics/tests/generics/Projections.kt b/compiler/testData/diagnostics/tests/generics/Projections.kt index e751811eb81..ca5ac18e5b2 100644 --- a/compiler/testData/diagnostics/tests/generics/Projections.kt +++ b/compiler/testData/diagnostics/tests/generics/Projections.kt @@ -36,13 +36,13 @@ fun testInOut() { Inv().f(1) (null as Inv).f(1) - (null as Inv).f(1) // !! - (null as Inv<*>).f(1) // !! + (null as Inv).f(1) // !! + (null as Inv<*>).f(1) // !! Inv().inf(1) (null as Inv).inf(1) - (null as Inv).inf(1) // !! - (null as Inv<*>).inf(1) // !! + (null as Inv).inf(1) // !! + (null as Inv<*>).inf(1) // !! Inv().outf() checkSubtype((null as Inv).outf()) // Type mismatch diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocalInsideInner.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocalInsideInner.kt index 7353627a470..b34e6d45fc5 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocalInsideInner.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocalInsideInner.kt @@ -46,7 +46,7 @@ class Outer { x().bar() checkType { _>() } x = foobar() - x = z.foobar() + x = z.foobar() var y = noParameters() y = noParameters() diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/innerTP.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/innerTP.kt index ad2154e0abc..c97b405bcfa 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/innerTP.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/innerTP.kt @@ -31,7 +31,7 @@ fun main() { checkSubtype.Inner<*>>(outer.Inner()) checkSubtype.Inner>(outer.bar()) - checkSubtype.Inner>(outer.Inner()) + checkSubtype.Inner>(outer.Inner()) outer.set(outer.bar()) outer.set(outer.Inner()) diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/innerUncheckedCast.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/innerUncheckedCast.kt index 73d216fb93c..fff3d4680bd 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/innerUncheckedCast.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/innerUncheckedCast.kt @@ -14,7 +14,7 @@ class Outer { if (y is Inner) return if (z is Inner) { - z.prop.checkType { _() } + z.prop.checkType { _() } return } diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/iterator.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/iterator.kt index fa48202eef8..16c710152ec 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/iterator.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/iterator.kt @@ -32,5 +32,5 @@ fun foo() { val csIt: Iterator = A().iterator() - commonSupertype(A().iterator(), A().iterator()).checkType { _.MyIt>() } + commonSupertype(A().iterator(), A().iterator()).checkType { _.MyIt>() } } diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/qualifiedOuter.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/qualifiedOuter.kt index bb9c10f2d8e..df123536253 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/qualifiedOuter.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/qualifiedOuter.kt @@ -5,7 +5,7 @@ class Outer { inner class Inner fun foo(x: Outer.Inner, y: Outer.Inner, z: Inner) { var inner = Inner() - x.checkType { _() } + x.checkType { _() } x.checkType { _.Inner>() } z.checkType { _() } z.checkType { _.Inner>() } diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/simpleOutUseSite.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/simpleOutUseSite.kt index 58130117bac..bcbf75f6f90 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/simpleOutUseSite.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/simpleOutUseSite.kt @@ -28,9 +28,9 @@ fun main() { checkSubtype.Inner>(outer.bar()) checkSubtype.Inner>(outer.Inner()) - outer.set(outer.bar()) - outer.set(outer.Inner()) + outer.set(outer.bar()) + outer.set(outer.Inner()) val x: Outer.Inner = factoryString() - outer.set(x) + outer.set(x) } diff --git a/compiler/testData/diagnostics/tests/generics/kt30590.kt b/compiler/testData/diagnostics/tests/generics/kt30590.kt index 065cd2c2fb7..7c2a6d5b6a8 100644 --- a/compiler/testData/diagnostics/tests/generics/kt30590.kt +++ b/compiler/testData/diagnostics/tests/generics/kt30590.kt @@ -5,4 +5,4 @@ interface A fun emptyStrangeMap(): Map = TODO() fun test7() : Map = emptyStrangeMap() -fun test() = emptyStrangeMap() +fun test() = emptyStrangeMap() diff --git a/compiler/testData/diagnostics/tests/generics/kt34729.kt b/compiler/testData/diagnostics/tests/generics/kt34729.kt index 9f993c27f14..03eb5f03a3a 100644 --- a/compiler/testData/diagnostics/tests/generics/kt34729.kt +++ b/compiler/testData/diagnostics/tests/generics/kt34729.kt @@ -13,6 +13,6 @@ fun bar(a: (Int) -> T) { } fun test() { - foo { } - bar { } + foo { } + bar { } } diff --git a/compiler/testData/diagnostics/tests/generics/nullability/expressionsBoundsViolation.kt b/compiler/testData/diagnostics/tests/generics/nullability/expressionsBoundsViolation.kt index 4d511fd15d0..ce2b515acc1 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/expressionsBoundsViolation.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/expressionsBoundsViolation.kt @@ -6,13 +6,12 @@ fun foo1(x: E) {} fun E.foo2() {} fun bar(x: F) { - A(x) + A(x) A<F>(x) - foo1(x) + foo1(x) foo1<F>(x) - x.foo2() + x.foo2() x.foo2<F>() } - diff --git a/compiler/testData/diagnostics/tests/generics/nullability/smartCasts.kt b/compiler/testData/diagnostics/tests/generics/nullability/smartCasts.kt index 0960439ba2e..341ff82d766 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/smartCasts.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/smartCasts.kt @@ -14,9 +14,9 @@ fun foo(x: T) { x.length x?.length - x.bar1() + x.bar1() x.bar2() - x.bar3() + x.bar3() x.bar4() @@ -29,7 +29,7 @@ fun foo(x: T) { x.length x?.length - x.bar1() + x.bar1() x.bar2() x.bar3() } @@ -38,7 +38,7 @@ fun foo(x: T) { x.length x?.length - x.bar1() + x.bar1() x.bar2() x.bar3() } diff --git a/compiler/testData/diagnostics/tests/generics/nullability/smartCastsOnThis.kt b/compiler/testData/diagnostics/tests/generics/nullability/smartCastsOnThis.kt index 40f25b33373..7c1ee10f311 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/smartCastsOnThis.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/smartCastsOnThis.kt @@ -10,13 +10,13 @@ fun T.foo() { if (this != null) { if (this != null) {} - length + length this?.length - bar1() + bar1() bar2() - bar3() - bar4() + bar3() + bar4() this?.bar1() @@ -28,8 +28,8 @@ fun T.foo() { length this?.length - bar1() + bar1() bar2() - bar3() + bar3() } } diff --git a/compiler/testData/diagnostics/tests/generics/nullability/smartCastsValueArgument.kt b/compiler/testData/diagnostics/tests/generics/nullability/smartCastsValueArgument.kt index c6bb3d8cf4b..34fe6c34e69 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/smartCastsValueArgument.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/smartCastsValueArgument.kt @@ -13,7 +13,7 @@ fun foo(x: T) { y1 = x y2 = x - bar1(x) + bar1(x) bar1(x) bar2(x) bar3(x) @@ -39,13 +39,13 @@ fun foo(x: T) { if (1 == 1) { val y = x!! - bar1(x) + bar1(x) bar1(x) bar2(x) bar3(x) - bar1(y) - bar2(y) + bar1(y) + bar2(y) bar3(y) } } diff --git a/compiler/testData/diagnostics/tests/generics/nullability/tpBoundsViolation.kt b/compiler/testData/diagnostics/tests/generics/nullability/tpBoundsViolation.kt index 6d16004c320..8df26301a06 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/tpBoundsViolation.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/tpBoundsViolation.kt @@ -17,7 +17,7 @@ class A { x2.checkType { _() } foo1<F?>(y) - foo1(y) + foo1(y) foo2(y) val x3 = foo2(y) @@ -37,7 +37,7 @@ class A { x4.checkType { _() } foo1<W>(w) - foo1(w) + foo1(w) foo2(w) val x6 = foo2(w) diff --git a/compiler/testData/diagnostics/tests/generics/nullability/tpBoundsViolationVariance.kt b/compiler/testData/diagnostics/tests/generics/nullability/tpBoundsViolationVariance.kt index df2221ef587..b67feaf885d 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/tpBoundsViolationVariance.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/tpBoundsViolationVariance.kt @@ -19,7 +19,7 @@ class A { fooInv1>(Inv()) fooInv2<Inv>(Inv()) fooInv1(Inv()) - fooInv2(Inv()) + fooInv2(Inv()) fooIn1>(In()) fooIn2>(In()) @@ -34,13 +34,13 @@ class A { // Z fooInv1<Inv>(Inv()) fooInv2<Inv>(Inv()) - fooInv1(Inv()) - fooInv2(Inv()) + fooInv1(Inv()) + fooInv2(Inv()) fooIn1<In>(In()) fooIn2<In>(In()) - fooIn1(In()) - fooIn2(In()) + fooIn1(In()) + fooIn2(In()) fooOut1>(Out()) fooOut2>(Out()) @@ -50,17 +50,17 @@ class A { // W fooInv1<Inv>(Inv()) fooInv2<Inv>(Inv()) - fooInv1(Inv()) - fooInv2(Inv()) + fooInv1(Inv()) + fooInv2(Inv()) fooIn1<In>(In()) fooIn2<In>(In()) - fooIn1(In()) - fooIn2(In()) + fooIn1(In()) + fooIn2(In()) fooOut1<Out>(Out()) fooOut2>(Out()) - fooOut1(Out()) + fooOut1(Out()) fooOut2(Out()) } } diff --git a/compiler/testData/diagnostics/tests/generics/nullability/useAsReceiver.kt b/compiler/testData/diagnostics/tests/generics/nullability/useAsReceiver.kt index 17998637049..38d6b9d8ad3 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/useAsReceiver.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/useAsReceiver.kt @@ -20,7 +20,7 @@ fun foo(x: T) { x?.bar1() x?.bar2() - x.bar3() + x.bar3() - x?.let { it.length } + x?.let { it.length } } diff --git a/compiler/testData/diagnostics/tests/generics/nullability/useAsValueArgument.kt b/compiler/testData/diagnostics/tests/generics/nullability/useAsValueArgument.kt index 05c72e519ae..2081749e5b8 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/useAsValueArgument.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/useAsValueArgument.kt @@ -12,6 +12,6 @@ fun foo(x: T) { bar1(x) bar2(x) - bar3(x) + bar3(x) bar4(x) } diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/addAll.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/addAll.kt index 08134790020..086969fa5e1 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/addAll.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/addAll.kt @@ -14,18 +14,18 @@ fun mc(): MC = null!! fun c(): C = null!! fun foo(x: MC) { - x.addAll(x) - x.addAllMC(x) + x.addAll(x) + x.addAllMC(x) - x.addAll(mc()) - x.addAllMC(mc()) + x.addAll(mc()) + x.addAllMC(mc()) - x.addAll(mc()) - x.addAllMC(mc()) + x.addAll(mc()) + x.addAllMC(mc()) x.addAll(c()) x.addAll(c()) - x.addAllInv(mc()) + x.addAllInv(mc()) x.addAll(1) } diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/extensionReceiverTypeMismatch.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/extensionReceiverTypeMismatch.kt index 6b98cff7f97..e652de641fa 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/extensionReceiverTypeMismatch.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/extensionReceiverTypeMismatch.kt @@ -8,10 +8,10 @@ fun test(x: A, y: Out) { with(x) { // TODO: this diagnostic could be replaced with TYPE_MISMATCH_DUE_TO_TYPE_PROJECTION "".foo() - y.bar() + y.bar() with(y) { - bar() + bar() } } } diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/inValueParameter.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/inValueParameter.kt index 7d019f81856..6d00b15763b 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/inValueParameter.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/inValueParameter.kt @@ -4,5 +4,5 @@ interface B { } fun foo(x: B, y: A) { - x.foo(y) + x.foo(y) } diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/multipleArgumentProjectedOut.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/multipleArgumentProjectedOut.kt index 812ef20d22b..6ee05ea6158 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/multipleArgumentProjectedOut.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/multipleArgumentProjectedOut.kt @@ -5,5 +5,5 @@ class A { } fun test(a: A) { - a.foo("", "") + a.foo("", "") } diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/projectedOutConventions.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/projectedOutConventions.kt index 104aa8869fa..70ec64013a8 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/projectedOutConventions.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/projectedOutConventions.kt @@ -7,7 +7,7 @@ class A { } fun test(a: A) { - a + "" - a[1] = "" - a[""] + a + "" + a[1] = "" + a[""] } diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/projectedOutSmartCast.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/projectedOutSmartCast.kt index b2a65a313af..c0b8f86f999 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/projectedOutSmartCast.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/projectedOutSmartCast.kt @@ -5,18 +5,18 @@ class C { } fun foo(x: Any?, y: C<*>) { - y.bindTo("") + y.bindTo("") if (x is C<*>) { - x.bindTo("") + x.bindTo("") with(x) { - bindTo("") + bindTo("") } } with(x) { if (this is C<*>) { - bindTo("") + bindTo("") } } } diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/typeMismatchConventions.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/typeMismatchConventions.kt index 49c400c9eb6..3e111f35339 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/typeMismatchConventions.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/typeMismatchConventions.kt @@ -9,9 +9,9 @@ class A { class Out fun test(a: A, y: Out) { - a + y - a[1] = y - a[y] + a + y + a[1] = y + a[y] a + Out() a[1] = Out() diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/typeParameterBounds.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/typeParameterBounds.kt index f65f208efe5..cbb6a8249de 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/typeParameterBounds.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/typeParameterBounds.kt @@ -12,15 +12,15 @@ class A { } fun foo2(a: A, b: A) { - a.foo1(Out()) - a.foo1<Out>(Out()) + a.foo1(Out()) + a.foo1<Out>(Out()) a.foo1(Out()) a.foo1(Out()) - a.foo2(Inv()) - a.foo2(Inv()) - a.foo2<Inv>(Inv()) + a.foo2(Inv()) + a.foo2(Inv()) + a.foo2<Inv>(Inv()) a.foo3(In()) a.foo3(In()) @@ -30,13 +30,13 @@ fun foo2(a: A, b: A) { b.foo1(Out()) b.foo1>(Out()) - b.foo2(Inv()) - b.foo2(Inv()) - b.foo2<Inv>(Inv()) + b.foo2(Inv()) + b.foo2(Inv()) + b.foo2<Inv>(Inv()) - b.foo3(In()) - b.foo3<In>(In()) + b.foo3(In()) + b.foo3<In>(In()) b.foo3(In()) b.foo3(In()) diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/varargs.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/varargs.kt index 7308ea36821..3082e5769c9 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/varargs.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/varargs.kt @@ -5,8 +5,8 @@ class A { } fun test(a: A, y: Array) { - a.foo("", "", "") - a.foo(*y) + a.foo("", "", "") + a.foo(*y) // TODO: TYPE_MISMATCH_DUE_TO_TYPE_PROJECTIONS probably redundant - a.foo(*y, "") + a.foo(*y, "") } diff --git a/compiler/testData/diagnostics/tests/generics/starProjections/invalid.kt b/compiler/testData/diagnostics/tests/generics/starProjections/invalid.kt index ff5029bd207..f378816a430 100644 --- a/compiler/testData/diagnostics/tests/generics/starProjections/invalid.kt +++ b/compiler/testData/diagnostics/tests/generics/starProjections/invalid.kt @@ -16,7 +16,7 @@ fun main(a: A<*>, j: JavaClass<*>, i2: Inv2<*>) { j.foo() checkType { _() } i2.x checkType { _() } - j.bar(1, 2, Any()) + j.bar(1, 2, Any()) j.bar(null) } diff --git a/compiler/testData/diagnostics/tests/generics/tpAsReified/InConstructor.kt b/compiler/testData/diagnostics/tests/generics/tpAsReified/InConstructor.kt index d2a85166754..c8e57da4172 100644 --- a/compiler/testData/diagnostics/tests/generics/tpAsReified/InConstructor.kt +++ b/compiler/testData/diagnostics/tests/generics/tpAsReified/InConstructor.kt @@ -3,7 +3,7 @@ class C<reified T> fun id(p: T): T = p fun main() { - C() + C() val a: C = C() C<A>() diff --git a/compiler/testData/diagnostics/tests/generics/tpAsReified/InFunction.kt b/compiler/testData/diagnostics/tests/generics/tpAsReified/InFunction.kt index eff39527cac..48ae341a911 100644 --- a/compiler/testData/diagnostics/tests/generics/tpAsReified/InFunction.kt +++ b/compiler/testData/diagnostics/tests/generics/tpAsReified/InFunction.kt @@ -9,7 +9,7 @@ inline fun f(): T = throw UnsupportedOperationException() fun id(p: T): T = p fun main() { - f() + f() val a: A = f() f<A>() diff --git a/compiler/testData/diagnostics/tests/generics/wrongNumberOfTypeArgumentsDiagnostic.kt b/compiler/testData/diagnostics/tests/generics/wrongNumberOfTypeArgumentsDiagnostic.kt index d899b0753e4..a436b2e3d79 100644 --- a/compiler/testData/diagnostics/tests/generics/wrongNumberOfTypeArgumentsDiagnostic.kt +++ b/compiler/testData/diagnostics/tests/generics/wrongNumberOfTypeArgumentsDiagnostic.kt @@ -4,12 +4,12 @@ fun myFun(i : String) {} fun myFun(i : Int) {} fun test1() { - myFun(3) + myFun(3) myFun('a') } fun test2() { - val m0 = java.util.HashMap() + val m0 = java.util.HashMap() val m1 = java.util.HashMap() val m2 = java.util.HashMap() } diff --git a/compiler/testData/diagnostics/tests/implicitIntersection.kt b/compiler/testData/diagnostics/tests/implicitIntersection.kt index 449fd529d9a..6e3886c7f06 100644 --- a/compiler/testData/diagnostics/tests/implicitIntersection.kt +++ b/compiler/testData/diagnostics/tests/implicitIntersection.kt @@ -6,24 +6,24 @@ interface A interface C // Error! -fun foo(b: B) = if (b is A && b is C) b else null +fun foo(b: B) = if (b is A && b is C) b else null // Ok: given explicitly fun gav(b: B): A? = if (b is A && b is C) b else null class My(b: B) { // Error! - val x = if (b is A && b is C) b else null + val x = if (b is A && b is C) b else null // Ok: given explicitly val y: C? = if (b is A && b is C) b else null // Error! - fun foo(b: B) = if (b is A && b is C) b else null + fun foo(b: B) = if (b is A && b is C) b else null } fun bar(b: B): String { // Ok: local variable val tmp = if (b is A && b is C) b else null // Error: local function - fun foo(b: B) = if (b is A && b is C) b else null + fun foo(b: B) = if (b is A && b is C) b else null return tmp.toString() } diff --git a/compiler/testData/diagnostics/tests/implicitNestedIntersection.kt b/compiler/testData/diagnostics/tests/implicitNestedIntersection.kt index 96e91be70b9..589b23dff7e 100644 --- a/compiler/testData/diagnostics/tests/implicitNestedIntersection.kt +++ b/compiler/testData/diagnostics/tests/implicitNestedIntersection.kt @@ -7,7 +7,7 @@ open class B : In fun select(x: T, y: T) = x -fun foo2() = select(A(), B()) // Type "In" is prohibited in return position +fun foo2() = select(A(), B()) // Type "In" is prohibited in return position @@ -20,4 +20,4 @@ open class H : In fun select8(a: S, b: S, c: S, d: S, e: S, f: S, g: S, h: S) = a -fun foo8() = select8(A(), B(), C(), D(), E(), F(), G(), H()) +fun foo8() = select8(A(), B(), C(), D(), E(), F(), G(), H()) diff --git a/compiler/testData/diagnostics/tests/imports/ClassClashStarImport.kt b/compiler/testData/diagnostics/tests/imports/ClassClashStarImport.kt index 03956ea2597..49019d9df3d 100644 --- a/compiler/testData/diagnostics/tests/imports/ClassClashStarImport.kt +++ b/compiler/testData/diagnostics/tests/imports/ClassClashStarImport.kt @@ -70,6 +70,6 @@ fun test(b: B) { val b_3 = B() b_3.m2() - val b_4 = a.B() - b_4.m2() + val b_4 = a.B() + b_4.m2() } diff --git a/compiler/testData/diagnostics/tests/imports/Imports.kt b/compiler/testData/diagnostics/tests/imports/Imports.kt index a55745d480b..d45d6abf67a 100644 --- a/compiler/testData/diagnostics/tests/imports/Imports.kt +++ b/compiler/testData/diagnostics/tests/imports/Imports.kt @@ -81,7 +81,7 @@ object C { } fun foo() { - if (i == 3) f() + if (i == 3) f() } //FILE:d.kt diff --git a/compiler/testData/diagnostics/tests/imports/twoImportLists.kt b/compiler/testData/diagnostics/tests/imports/twoImportLists.kt index ac2f6b8ee97..c12c50610b4 100644 --- a/compiler/testData/diagnostics/tests/imports/twoImportLists.kt +++ b/compiler/testData/diagnostics/tests/imports/twoImportLists.kt @@ -84,7 +84,7 @@ object C { } fun foo() { - if (i == 3) f() + if (i == 3) f() } //FILE:d.kt diff --git a/compiler/testData/diagnostics/tests/incompleteCode/NoSenselessComparisonForErrorType.kt b/compiler/testData/diagnostics/tests/incompleteCode/NoSenselessComparisonForErrorType.kt index 42221848c08..fe63448dba3 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/NoSenselessComparisonForErrorType.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/NoSenselessComparisonForErrorType.kt @@ -2,7 +2,7 @@ package a fun foo() { val a = getErrorType() - if (a == null) { //no senseless comparison + if (a == null) { //no senseless comparison } } diff --git a/compiler/testData/diagnostics/tests/incompleteCode/checkNothingIsSubtype.kt b/compiler/testData/diagnostics/tests/incompleteCode/checkNothingIsSubtype.kt index 2586168dfdc..194c30b40ba 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/checkNothingIsSubtype.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/checkNothingIsSubtype.kt @@ -6,7 +6,7 @@ interface A fun infer(a: A) : T {} fun test(nothing: Nothing?) { - val i = infer(nothing) + val i = infer(nothing) } fun sum(a : IntArray) : Int { diff --git a/compiler/testData/diagnostics/tests/incompleteCode/controlStructuresErrors.kt b/compiler/testData/diagnostics/tests/incompleteCode/controlStructuresErrors.kt index c4f23e769c3..dcde1be3527 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/controlStructuresErrors.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/controlStructuresErrors.kt @@ -1,19 +1,18 @@ - fun test1() { if (rr) { if (l) { - a.q() + a.q() } else { - a.w() + a.w() } } else { if (n) { - a.t() + a.t() } else { - a.u() + a.u() } } } diff --git a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/arrayExpression.kt b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/arrayExpression.kt index f5cabf77236..2c98f5472c3 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/arrayExpression.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/arrayExpression.kt @@ -3,5 +3,5 @@ package bar fun main() { class Some - Some[] names = ["ads"] + Some[] names = ["ads"] } diff --git a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/noTypeParamsInReturnType.kt b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/noTypeParamsInReturnType.kt index 3bd91b697a5..33b070810cc 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/noTypeParamsInReturnType.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/noTypeParamsInReturnType.kt @@ -5,5 +5,5 @@ fun foo(map: Map) : R = throw Exception() fun getMap() : Map = throw Exception() fun bar123() { - foo(getMap( + foo(getMap( } diff --git a/compiler/testData/diagnostics/tests/inference/NoInferenceFromDeclaredBounds.kt b/compiler/testData/diagnostics/tests/inference/NoInferenceFromDeclaredBounds.kt index 8a51ba2f890..86021c301c0 100644 --- a/compiler/testData/diagnostics/tests/inference/NoInferenceFromDeclaredBounds.kt +++ b/compiler/testData/diagnostics/tests/inference/NoInferenceFromDeclaredBounds.kt @@ -3,7 +3,7 @@ fun fooT22() : T? { } fun foo1() { - fooT22() + fooT22() } val n : Nothing = null.sure() diff --git a/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveAmbiguity.kt b/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveAmbiguity.kt index 86daf144206..1ee62f30377 100644 --- a/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveAmbiguity.kt +++ b/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveAmbiguity.kt @@ -4,5 +4,5 @@ fun g(i: Int, a: Any): List {throw Exception()} fun g(a: Any, i: Int): Collection {throw Exception()} fun test() { - val c: List = g(1, 1) + val c: List = g(1, 1) } diff --git a/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveFunctionLiteralsNoUse.kt b/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveFunctionLiteralsNoUse.kt index c8eff93154e..c90d9f55e36 100644 --- a/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveFunctionLiteralsNoUse.kt +++ b/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveFunctionLiteralsNoUse.kt @@ -3,4 +3,4 @@ package f fun h(i: Int, a: Any, r: R, f: (Boolean) -> Int) = 1 fun h(a: Any, i: Int, r: R, f: (Boolean) -> Int) = 1 -fun test() = h(1, 1, 1, { b -> 42 }) +fun test() = h(1, 1, 1, { b -> 42 }) diff --git a/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveNoInfoForParameter.kt b/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveNoInfoForParameter.kt index 8a3f2b008e5..c2116e2279b 100644 --- a/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveNoInfoForParameter.kt +++ b/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveNoInfoForParameter.kt @@ -4,7 +4,7 @@ fun f(i: Int, c: Collection): List {throw Exception()} fun f(a: Any, l: List): Collection {throw Exception()} fun test(l: List) { - f(1, emptyList()) + f(1, emptyList()) } fun emptyList(): List {throw Exception()} diff --git a/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveWithFunctionLiterals.kt b/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveWithFunctionLiterals.kt index 69db5cc44ef..4f7d4791c23 100644 --- a/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveWithFunctionLiterals.kt +++ b/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveWithFunctionLiterals.kt @@ -4,6 +4,6 @@ package f fun h(f: (Boolean) -> R) = 1 fun h(f: (String) -> R) = 2 -fun test() = h{ i -> getAnswer() } +fun test() = h{ i -> getAnswer() } fun getAnswer() = 42 diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/cannotCaptureInProjection.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/cannotCaptureInProjection.kt index 5a81b61c0c8..381f116b394 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/cannotCaptureInProjection.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/cannotCaptureInProjection.kt @@ -4,13 +4,13 @@ fun bar(a: Array): Array = null!! fun test1(a: Array) { - val r: Array = bar(a) - bar(a) + val r: Array = bar(a) + bar(a) } fun foo(l: Array): Array> = null!! fun test2(a: Array) { - val r: Array> = foo(a) - foo(a) + val r: Array> = foo(a) + foo(a) } diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/captureForNullableTypes.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/captureForNullableTypes.kt index fbb90ff3508..5ed6b546809 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/captureForNullableTypes.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/captureForNullableTypes.kt @@ -4,15 +4,15 @@ fun bar(a: Array): Array = null!! fun test1(a: Array) { - val r: Array = bar(a) - val t = bar(a) - t checkType { _>() } + val r: Array = bar(a) + val t = bar(a) + t checkType { _>() } } fun foo(l: Array): Array> = null!! fun test2(a: Array) { - val r: Array> = foo(a) - val t = foo(a) - t checkType { _>>() } + val r: Array> = foo(a) + val t = foo(a) + t checkType { _>>() } } diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/captureFromNullableTypeVariable.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/captureFromNullableTypeVariable.kt index 6ec7122de23..36423603e52 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/captureFromNullableTypeVariable.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/captureFromNullableTypeVariable.kt @@ -3,11 +3,11 @@ fun Array.filterNotNull(): List = throw Exception() fun test1(a: Array) { - val list = a.filterNotNull() - list checkType { _>() } + val list = a.filterNotNull() + list checkType { _>() } } fun test2(vararg a: Int?) { - val list = a.filterNotNull() - list checkType { _>() } + val list = a.filterNotNull() + list checkType { _>() } } diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/captureTypeOnlyOnTopLevel.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/captureTypeOnlyOnTopLevel.kt index 5fbbf48caf5..f1239dc2163 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/captureTypeOnlyOnTopLevel.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/captureTypeOnlyOnTopLevel.kt @@ -3,7 +3,7 @@ fun foo(array: Array>): Array> = array fun test(array: Array>) { - foo(array) + foo(array) - val f: Array> = foo(array) + val f: Array> = foo(array) } diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/expectedTypeMismatchWithInVariance.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/expectedTypeMismatchWithInVariance.kt index 8473202cc19..dec027aaa9c 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/expectedTypeMismatchWithInVariance.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/expectedTypeMismatchWithInVariance.kt @@ -4,6 +4,6 @@ fun foo(a1: Array, a2: Array): T = null!! fun test(a1: Array, a2: Array) { - val c: Int = foo(a1, a2) + val c: Int = foo(a1, a2) } diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/kt2872.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/kt2872.kt index d8264cd424e..66f5ea3b673 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/kt2872.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/kt2872.kt @@ -2,5 +2,5 @@ fun Array.foo() {} fun test(array: Array) { array.foo() - array.foo<out Int>() + array.foo<out Int>() } diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/noCaptureTypeErrorForNonTopLevel.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/noCaptureTypeErrorForNonTopLevel.kt index ac9360ccf02..49daf301070 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/noCaptureTypeErrorForNonTopLevel.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/noCaptureTypeErrorForNonTopLevel.kt @@ -10,7 +10,7 @@ fun bar(b: B>, bOut: B>, bOut2: B(b) - baz(bOut) + baz(bOut) baz(bOut) baz(bOut2) diff --git a/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithExpectedTypeAndBound.kt b/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithExpectedTypeAndBound.kt index 82af478d09f..b2096a740cd 100644 --- a/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithExpectedTypeAndBound.kt +++ b/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithExpectedTypeAndBound.kt @@ -1,12 +1,11 @@ - fun materializeNumber(): T = TODO() fun a(): Unit = run { - materializeNumber() + materializeNumber() } fun b(): Unit = run { run { - materializeNumber() + materializeNumber() } } diff --git a/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithoutExpectedType.kt b/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithoutExpectedType.kt index 2984d99ac31..ec97a534275 100644 --- a/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithoutExpectedType.kt +++ b/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithoutExpectedType.kt @@ -1,4 +1,3 @@ - fun materialize(): T = TODO() fun implicitCoercion() { @@ -13,6 +12,6 @@ fun implicitCoercion() { val c = l@{ // Error: block doesn't have an expected type, so call can't be inferred! - return@l materialize() + return@l materialize() } } diff --git a/compiler/testData/diagnostics/tests/inference/coercionToUnit/coersionWithAnonymousFunctionsAndUnresolved.kt b/compiler/testData/diagnostics/tests/inference/coercionToUnit/coersionWithAnonymousFunctionsAndUnresolved.kt index 956de346b32..2d4a3eebe88 100644 --- a/compiler/testData/diagnostics/tests/inference/coercionToUnit/coersionWithAnonymousFunctionsAndUnresolved.kt +++ b/compiler/testData/diagnostics/tests/inference/coercionToUnit/coersionWithAnonymousFunctionsAndUnresolved.kt @@ -53,7 +53,7 @@ fun testParameter() { takeFnToParameter { Unit } takeFnToParameter { unresolved() } takeFnToParameter { if (true) unresolved() } - takeFnToParameter { + takeFnToParameter { if (true) unresolved() else unresolved() } takeFnToParameter(fun() = Unit) diff --git a/compiler/testData/diagnostics/tests/inference/coercionToUnit/indirectCoercionWithExpectedType.kt b/compiler/testData/diagnostics/tests/inference/coercionToUnit/indirectCoercionWithExpectedType.kt index c56c02b7460..f1e66019d15 100644 --- a/compiler/testData/diagnostics/tests/inference/coercionToUnit/indirectCoercionWithExpectedType.kt +++ b/compiler/testData/diagnostics/tests/inference/coercionToUnit/indirectCoercionWithExpectedType.kt @@ -1,4 +1,3 @@ - fun materialize(): T = TODO() fun a(): Unit = run { @@ -18,13 +17,13 @@ fun c(): Unit = run { // Attention! // In OI expected type 'Unit' isn't applied here because of implementation quirks (note that OI still applies Unit in case 'e') // In NI, it is applied and call is correctly inferred, which is consistent with the previous case - materialize() + materialize() } } fun d(): Unit = run outer@{ run inner@{ - return@inner materialize() + return@inner materialize() } } diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/kt32818.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/kt32818.kt index aa14bc206ff..62771517349 100644 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/kt32818.kt +++ b/compiler/testData/diagnostics/tests/inference/commonSystem/kt32818.kt @@ -3,5 +3,5 @@ fun nullable(): T? = null fun test() { - val value = nullable() ?: nullable() + val value = nullable() ?: nullable() } diff --git a/compiler/testData/diagnostics/tests/inference/completeInferenceIfManyFailed.kt b/compiler/testData/diagnostics/tests/inference/completeInferenceIfManyFailed.kt index cee1a1d7013..eedd0bc1fd6 100644 --- a/compiler/testData/diagnostics/tests/inference/completeInferenceIfManyFailed.kt +++ b/compiler/testData/diagnostics/tests/inference/completeInferenceIfManyFailed.kt @@ -13,6 +13,6 @@ fun joinT(x: Comparable<*>, y: T): T? { } fun test() { - val x2 = joinT(Unit, "2") + val x2 = joinT(Unit, "2") checkSubtype(x2) } diff --git a/compiler/testData/diagnostics/tests/inference/conflictingSubstitutions.kt b/compiler/testData/diagnostics/tests/inference/conflictingSubstitutions.kt index 6d70dc89f1c..7041d68261b 100644 --- a/compiler/testData/diagnostics/tests/inference/conflictingSubstitutions.kt +++ b/compiler/testData/diagnostics/tests/inference/conflictingSubstitutions.kt @@ -7,9 +7,9 @@ fun elemAndList(r: R, t: MutableList): R = r fun R.elemAndListWithReceiver(r: R, t: MutableList): R = r fun test() { - val s = elemAndList(11, list("72")) + val s = elemAndList(11, list("72")) - val u = 11.elemAndListWithReceiver(4, list("7")) + val u = 11.elemAndListWithReceiver(4, list("7")) } fun list(value: T) : ArrayList { diff --git a/compiler/testData/diagnostics/tests/inference/constraints/constraintFromVariantTypeWithNestedProjection.kt b/compiler/testData/diagnostics/tests/inference/constraints/constraintFromVariantTypeWithNestedProjection.kt index bec3b059a21..84bd20e4b14 100644 --- a/compiler/testData/diagnostics/tests/inference/constraints/constraintFromVariantTypeWithNestedProjection.kt +++ b/compiler/testData/diagnostics/tests/inference/constraints/constraintFromVariantTypeWithNestedProjection.kt @@ -10,6 +10,6 @@ fun choose3(c: Inv>) {} fun f(o: Out>, i: In>, inv: Inv>) { choose1(o) - choose2(i) - choose3(inv) + choose2(i) + choose3(inv) } diff --git a/compiler/testData/diagnostics/tests/inference/constraints/constraintOnFunctionLiteral.kt b/compiler/testData/diagnostics/tests/inference/constraints/constraintOnFunctionLiteral.kt index 9003814c25d..45a75ba0b02 100644 --- a/compiler/testData/diagnostics/tests/inference/constraints/constraintOnFunctionLiteral.kt +++ b/compiler/testData/diagnostics/tests/inference/constraints/constraintOnFunctionLiteral.kt @@ -2,10 +2,9 @@ package c import java.util.ArrayList -fun Array.toIntArray(): IntArray = this.mapTo(IntArray(size), {it}) +fun Array.toIntArray(): IntArray = this.mapTo(IntArray(size), {it}) fun Array.toArrayList(): ArrayList = this.mapTo(ArrayList(size), {it}) public fun > Array.mapTo(result: C, transform : (T) -> R) : C = throw Exception("$result $transform") - diff --git a/compiler/testData/diagnostics/tests/inference/constraints/kt6320.kt b/compiler/testData/diagnostics/tests/inference/constraints/kt6320.kt index f2869dc5e6d..7483aab3234 100644 --- a/compiler/testData/diagnostics/tests/inference/constraints/kt6320.kt +++ b/compiler/testData/diagnostics/tests/inference/constraints/kt6320.kt @@ -15,6 +15,6 @@ class C class D(foo: C) { fun test(a: C) { - val d: D = D(a) + val d: D = D(a) } } diff --git a/compiler/testData/diagnostics/tests/inference/constraints/kt8879.kt b/compiler/testData/diagnostics/tests/inference/constraints/kt8879.kt index 702f91eca82..caa6880dc8e 100644 --- a/compiler/testData/diagnostics/tests/inference/constraints/kt8879.kt +++ b/compiler/testData/diagnostics/tests/inference/constraints/kt8879.kt @@ -8,5 +8,5 @@ fun > foo(klass: Inv): String? = null fun bar(): Inv = null!! fun test() { - foo(bar()) + foo(bar()) } diff --git a/compiler/testData/diagnostics/tests/inference/constraints/manyConstraintsDueToRecursiveFlexibleTypesWithWildcards.kt b/compiler/testData/diagnostics/tests/inference/constraints/manyConstraintsDueToRecursiveFlexibleTypesWithWildcards.kt index 64059a3760c..b83edc82577 100644 --- a/compiler/testData/diagnostics/tests/inference/constraints/manyConstraintsDueToRecursiveFlexibleTypesWithWildcards.kt +++ b/compiler/testData/diagnostics/tests/inference/constraints/manyConstraintsDueToRecursiveFlexibleTypesWithWildcards.kt @@ -27,5 +27,5 @@ abstract class MySettingsListener {} fun test() { val a = MySettings.getSettings() a.getLinkedProjectsSettings() - a.linkedProjectsSettings + a.linkedProjectsSettings } diff --git a/compiler/testData/diagnostics/tests/inference/constraints/notNullConstraintOnNullableType.kt b/compiler/testData/diagnostics/tests/inference/constraints/notNullConstraintOnNullableType.kt index 730306295d9..ebb32733fdf 100644 --- a/compiler/testData/diagnostics/tests/inference/constraints/notNullConstraintOnNullableType.kt +++ b/compiler/testData/diagnostics/tests/inference/constraints/notNullConstraintOnNullableType.kt @@ -17,8 +17,8 @@ fun test(out: Out, i: In, inv: A) { r checkType { _() } // T? <: Int => error - doIn(i) + doIn(i) // T? >: Int => error - doA(inv) + doA(inv) } diff --git a/compiler/testData/diagnostics/tests/inference/dependantOnVariance.kt b/compiler/testData/diagnostics/tests/inference/dependantOnVariance.kt index b45c3bc600d..ce768e2a60c 100644 --- a/compiler/testData/diagnostics/tests/inference/dependantOnVariance.kt +++ b/compiler/testData/diagnostics/tests/inference/dependantOnVariance.kt @@ -13,7 +13,7 @@ fun readFromMyList(l: MyList, t: T) {} fun test1(int: Int, any: Any) { val a0 : MyList = getMyList(int) - val a1 : MyList = getMyList(any) + val a1 : MyList = getMyList(any) val a2 : MyList = getMyList(int) @@ -28,23 +28,23 @@ fun test1(int: Int, any: Any) { val a7 : MyList = getMyList(int) val a8 : MyList = getMyListToReadFrom(int) - val a9 : MyList = getMyListToReadFrom(int) + val a9 : MyList = getMyListToReadFrom(int) val a10 : MyList = getMyList(any) - val a11 : MyList = getMyList(any) + val a11 : MyList = getMyList(any) val a12 : MyList = getMyListToWriteTo(any) - val a13 : MyList = getMyListToWriteTo(any) + val a13 : MyList = getMyListToWriteTo(any) useMyList(getMyList(int), int) useMyList(getMyList(any), int) - useMyList(getMyList(int), any) + useMyList(getMyList(int), any) readFromMyList(getMyList(int), any) readFromMyList(getMyList(any), int) - readFromMyList(getMyList(any), int) + readFromMyList(getMyList(any), int) - readFromMyList(getMyListToReadFrom(any), int) + readFromMyList(getMyListToReadFrom(any), int) readFromMyList(getMyListToReadFrom(any), int) readFromMyList(getMyListToReadFrom(int), any) @@ -53,14 +53,14 @@ fun test1(int: Int, any: Any) { writeToMyList(getMyList(any), int) writeToMyList(getMyList(int), any) writeToMyList(getMyList(int), any) - writeToMyList(getMyList(int), any) + writeToMyList(getMyList(int), any) writeToMyList(getMyListToWriteTo(any), int) - writeToMyList(getMyListToWriteTo(int), any) + writeToMyList(getMyListToWriteTo(int), any) readFromMyList(getMyListToWriteTo(any), any) - writeToMyList(getMyListToReadFrom(any), any) + writeToMyList(getMyListToReadFrom(any), any) use(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13) } diff --git a/compiler/testData/diagnostics/tests/inference/expectedTypeAdditionalTest.kt b/compiler/testData/diagnostics/tests/inference/expectedTypeAdditionalTest.kt index 67a862daf57..9b091bb8c2f 100644 --- a/compiler/testData/diagnostics/tests/inference/expectedTypeAdditionalTest.kt +++ b/compiler/testData/diagnostics/tests/inference/expectedTypeAdditionalTest.kt @@ -6,7 +6,7 @@ fun foo() = foo() as T fun foo2(): T = TODO() -val test = foo2().plus("") as String +val test = foo2().plus("") as String fun T.bar() = this val barTest = "".bar() as Number diff --git a/compiler/testData/diagnostics/tests/inference/expectedTypeDoubleReceiver.kt b/compiler/testData/diagnostics/tests/inference/expectedTypeDoubleReceiver.kt index 7aca4352654..4fca897921f 100644 --- a/compiler/testData/diagnostics/tests/inference/expectedTypeDoubleReceiver.kt +++ b/compiler/testData/diagnostics/tests/inference/expectedTypeDoubleReceiver.kt @@ -8,12 +8,11 @@ class A { fun id(value: V) = value -val asA = foo().fooA() as A +val asA = foo().fooA() as A -val receiverParenthesized = (foo()).fooA() as A -val no2A = A().fooA().fooA() as A +val receiverParenthesized = (foo()).fooA() as A +val no2A = A().fooA().fooA() as A val correct1 = A().fooA() as A val correct2 = foo().fooA() as A val correct3 = A().fooA().fooA() as A - diff --git a/compiler/testData/diagnostics/tests/inference/expectedTypeFromCast.kt b/compiler/testData/diagnostics/tests/inference/expectedTypeFromCast.kt index 958a9bd62dd..402b7d650f8 100644 --- a/compiler/testData/diagnostics/tests/inference/expectedTypeFromCast.kt +++ b/compiler/testData/diagnostics/tests/inference/expectedTypeFromCast.kt @@ -6,7 +6,7 @@ fun id(value: V) = value val asString = foo() as String -val viaId = id(foo()) as String +val viaId = id(foo()) as String val insideId = id(foo() as String) @@ -16,5 +16,5 @@ val asStarList = foo() as List<*> val safeAs = foo() as? String -val fromIs = foo() is String -val fromNoIs = foo() !is String +val fromIs = foo() is String +val fromNoIs = foo() !is String diff --git a/compiler/testData/diagnostics/tests/inference/expectedTypeWithGenerics.kt b/compiler/testData/diagnostics/tests/inference/expectedTypeWithGenerics.kt index baa1cdf33c5..cdf2e017bf5 100644 --- a/compiler/testData/diagnostics/tests/inference/expectedTypeWithGenerics.kt +++ b/compiler/testData/diagnostics/tests/inference/expectedTypeWithGenerics.kt @@ -11,7 +11,7 @@ fun test(x: X) { fun g() { fun foo(): T = TODO() - val y = foo() as Int + val y = foo() as Int val y2 = foo() as D } diff --git a/compiler/testData/diagnostics/tests/inference/fixationOrderForProperConstraints.kt b/compiler/testData/diagnostics/tests/inference/fixationOrderForProperConstraints.kt index ba8576f56e0..17dbcf48d09 100644 --- a/compiler/testData/diagnostics/tests/inference/fixationOrderForProperConstraints.kt +++ b/compiler/testData/diagnostics/tests/inference/fixationOrderForProperConstraints.kt @@ -3,4 +3,4 @@ fun foo(f: (Y) -> Z, g: (X) -> Y, x: X): Z = f(g(x)) // TODO: Actually, this is a bug and will work when new inference is enabled // see ([NI] Select variable with proper non-trivial constraint first) for more details -fun test() = foo({ it + 1 }, { it.length }, "") +fun test() = foo({ it + 1 }, { it.length }, "") diff --git a/compiler/testData/diagnostics/tests/inference/functionPlaceholderError.kt b/compiler/testData/diagnostics/tests/inference/functionPlaceholderError.kt index 35b58a21d1a..338c1397a81 100644 --- a/compiler/testData/diagnostics/tests/inference/functionPlaceholderError.kt +++ b/compiler/testData/diagnostics/tests/inference/functionPlaceholderError.kt @@ -12,5 +12,5 @@ fun test() { val q = foo(fun Int.() {}, emptyList()) //type inference no information for parameter error checkSubtype(q) - foo({}, emptyList()) + foo({}, emptyList()) } diff --git a/compiler/testData/diagnostics/tests/inference/implicitInvokeExtensionWithFunctionalArgument.kt b/compiler/testData/diagnostics/tests/inference/implicitInvokeExtensionWithFunctionalArgument.kt index 0fae38e8a42..1d68322817f 100644 --- a/compiler/testData/diagnostics/tests/inference/implicitInvokeExtensionWithFunctionalArgument.kt +++ b/compiler/testData/diagnostics/tests/inference/implicitInvokeExtensionWithFunctionalArgument.kt @@ -24,5 +24,5 @@ fun test(s: SelectorFor): Double { val e = s { return p1 } e checkType { _>() } - return null!! + return null!! } diff --git a/compiler/testData/diagnostics/tests/inference/kt28598.kt b/compiler/testData/diagnostics/tests/inference/kt28598.kt index 083d76ebd6a..4c3519132af 100644 --- a/compiler/testData/diagnostics/tests/inference/kt28598.kt +++ b/compiler/testData/diagnostics/tests/inference/kt28598.kt @@ -2,7 +2,7 @@ fun case_1(a: MutableList?>?>?>?>?>?>?) { if (a != null) { - val b = a[0] // no SMARTCAST diagnostic + val b = a[0] // no SMARTCAST diagnostic if (b != null) { val c = b[0] if (c != null) { @@ -30,19 +30,19 @@ fun case_1(a: MutableList?>?>?>?>?>?>?) { if (a != null) { - val b = a[0] // no SMARTCAST diagnostic + val b = a[0] // no SMARTCAST diagnostic if (b != null) { val c = b[0] if (c != null) { val d = c[0] if (d != null) { - val e = d[0] // no SMARTCAST diagnostic + val e = d[0] // no SMARTCAST diagnostic if (e != null) { val f = e[0] if (f != null) { val g = f[0] if (g != null) { - val h = g[0] // no SMARTCAST diagnostic + val h = g[0] // no SMARTCAST diagnostic if (h != null) { h.inc() } diff --git a/compiler/testData/diagnostics/tests/inference/kt28654.kt b/compiler/testData/diagnostics/tests/inference/kt28654.kt index d3dcbde3d44..5597f73206d 100644 --- a/compiler/testData/diagnostics/tests/inference/kt28654.kt +++ b/compiler/testData/diagnostics/tests/inference/kt28654.kt @@ -1,9 +1,9 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE // Related issue: KT-28654 -fun select(): K = run { } +fun select(): K = run { } fun test() { val x: Int = select() - val t = select() + val t = select() } diff --git a/compiler/testData/diagnostics/tests/inference/kt6175.kt b/compiler/testData/diagnostics/tests/inference/kt6175.kt index 5f359b9039f..530b25cba2a 100644 --- a/compiler/testData/diagnostics/tests/inference/kt6175.kt +++ b/compiler/testData/diagnostics/tests/inference/kt6175.kt @@ -3,10 +3,10 @@ fun foo(body: (R?) -> T): T = fail() fun test1() { - foo { + foo { true } - foo { x -> + foo { x -> true } } @@ -15,10 +15,10 @@ fun test1() { fun bar(body: (R) -> T): T = fail() fun test2() { - bar { + bar { true } - bar { x -> + bar { x -> true } } @@ -26,10 +26,10 @@ fun test2() { fun baz(body: (List) -> T): T = fail() fun test3() { - baz { + baz { true } - baz { x -> + baz { x -> true } } @@ -37,10 +37,10 @@ fun test3() { fun brr(body: (List) -> T): T = fail() fun test4() { - brr { + brr { true } - brr { x -> + brr { x -> true } } diff --git a/compiler/testData/diagnostics/tests/inference/nestedCalls/binaryExpressions.kt b/compiler/testData/diagnostics/tests/inference/nestedCalls/binaryExpressions.kt index 59f2fc047b4..06e75f318e2 100644 --- a/compiler/testData/diagnostics/tests/inference/nestedCalls/binaryExpressions.kt +++ b/compiler/testData/diagnostics/tests/inference/nestedCalls/binaryExpressions.kt @@ -13,7 +13,7 @@ fun id(t: T): T = t infix fun Z.foo(a: A): A = a fun test(z: Z) { - z foo newA() + z foo newA() val a: A = id(z foo newA()) val b: A = id(z.foo(newA())) use(a, b) @@ -23,7 +23,7 @@ fun test(z: Z) { operator fun Z.plus(a: A): A = a fun test1(z: Z) { - id(z + newA()) + id(z + newA()) val a: A = z + newA() val b: A = z.plus(newA()) val c: A = id(z + newA()) @@ -35,7 +35,7 @@ fun test1(z: Z) { operator fun Z.compareTo(a: A): Int { use(a); return 1 } fun test2(z: Z) { - val a: Boolean = id(z < newA()) + val a: Boolean = id(z < newA()) val b: Boolean = id(z < newA()) use(a, b) } @@ -44,18 +44,18 @@ fun test2(z: Z) { fun Z.equals(any: Any): Int { use(any); return 1 } fun test3(z: Z) { - z == newA() + z == newA() z == newA() - id(z == newA()) + id(z == newA()) id(z == newA()) - id(z === newA()) + id(z === newA()) id(z === newA()) } //'in' operation fun test4(collection: Collection>) { - id(newA() in collection) + id(newA() in collection) id(newA() in collection) } @@ -63,7 +63,7 @@ fun test4(collection: Collection>) { fun toBeOrNot(): Boolean = throw Exception() fun test5() { - if (toBeOrNot() && toBeOrNot()) {} + if (toBeOrNot() && toBeOrNot()) {} if (toBeOrNot() && toBeOrNot()) {} } diff --git a/compiler/testData/diagnostics/tests/inference/noInformationForParameter.kt b/compiler/testData/diagnostics/tests/inference/noInformationForParameter.kt index 27256dbee90..5044d325e80 100644 --- a/compiler/testData/diagnostics/tests/inference/noInformationForParameter.kt +++ b/compiler/testData/diagnostics/tests/inference/noInformationForParameter.kt @@ -4,7 +4,7 @@ package noInformationForParameter import java.util.* fun test() { - val n = newList() + val n = newList() val n1 : List = newList() } diff --git a/compiler/testData/diagnostics/tests/inference/nonFunctionalExpectedTypeForLambdaArgument.kt b/compiler/testData/diagnostics/tests/inference/nonFunctionalExpectedTypeForLambdaArgument.kt index 5f1095c2065..630d0a7a116 100644 --- a/compiler/testData/diagnostics/tests/inference/nonFunctionalExpectedTypeForLambdaArgument.kt +++ b/compiler/testData/diagnostics/tests/inference/nonFunctionalExpectedTypeForLambdaArgument.kt @@ -14,19 +14,19 @@ fun testAny() { fun testAnyCall() { callAny { - error -> error() + error -> error() } } fun testParam() { - callParam { + callParam { param -> param } } fun testParamCall() { - callParam { - param -> param() + callParam { + param -> param() } } diff --git a/compiler/testData/diagnostics/tests/inference/nothingType/kt34335.kt b/compiler/testData/diagnostics/tests/inference/nothingType/kt34335.kt index 82d4917eb75..a9d5e97bb09 100644 --- a/compiler/testData/diagnostics/tests/inference/nothingType/kt34335.kt +++ b/compiler/testData/diagnostics/tests/inference/nothingType/kt34335.kt @@ -10,9 +10,9 @@ fun foo(action: (Int) -> Unit) { } fun test1() { - call({ x -> println(x::class) }) // x inside the lambda is inferred to `Nothing`, the lambda is `(Nothing) -> Unit`. + call({ x -> println(x::class) }) // x inside the lambda is inferred to `Nothing`, the lambda is `(Nothing) -> Unit`. } fun test2() { - ::foo.call({ x -> println(x::class) }) + ::foo.call({ x -> println(x::class) }) } diff --git a/compiler/testData/diagnostics/tests/inference/nothingType/lambdaNothingAndExpectedType.kt b/compiler/testData/diagnostics/tests/inference/nothingType/lambdaNothingAndExpectedType.kt index 2c734b6ea6e..d4537af5218 100644 --- a/compiler/testData/diagnostics/tests/inference/nothingType/lambdaNothingAndExpectedType.kt +++ b/compiler/testData/diagnostics/tests/inference/nothingType/lambdaNothingAndExpectedType.kt @@ -4,8 +4,8 @@ fun select2(x: K, y: K): K = TODO() fun select3(x: K, y: K, z: K): K = TODO() fun test2(f: ((String) -> Int)?) { - val a0: ((Int) -> Int)? = select2({ it -> it }, null) - val b0: ((Nothing) -> Unit)? = select2({ it -> it }, null) + val a0: ((Int) -> Int)? = select2({ it -> it }, null) + val b0: ((Nothing) -> Unit)? = select2({ it -> it }, null) select3({ it.length }, f, null) } diff --git a/compiler/testData/diagnostics/tests/inference/nothingType/notEnoughInformationFromNullabilityConstraint.kt b/compiler/testData/diagnostics/tests/inference/nothingType/notEnoughInformationFromNullabilityConstraint.kt index b6590aa510e..94e1c869f24 100644 --- a/compiler/testData/diagnostics/tests/inference/nothingType/notEnoughInformationFromNullabilityConstraint.kt +++ b/compiler/testData/diagnostics/tests/inference/nothingType/notEnoughInformationFromNullabilityConstraint.kt @@ -5,11 +5,11 @@ fun id(arg: I): I = arg fun select(vararg args: S): S = TODO() fun test() { - id( - make() + id( + make() ) select(make(), null) - if (true) make() else TODO() + if (true) make() else TODO() } diff --git a/compiler/testData/diagnostics/tests/inference/possibleCycleOnConstraints.kt b/compiler/testData/diagnostics/tests/inference/possibleCycleOnConstraints.kt index 1380320c6df..a1805f4560a 100644 --- a/compiler/testData/diagnostics/tests/inference/possibleCycleOnConstraints.kt +++ b/compiler/testData/diagnostics/tests/inference/possibleCycleOnConstraints.kt @@ -6,8 +6,8 @@ fun g (f: () -> List) : T {} fun test() { //here possibly can be a cycle on constraints - val x = g { Collections.emptyList() } + val x = g { Collections.emptyList() } val y = g { Collections.emptyList() } - val z : List = g { Collections.emptyList() } + val z : List = g { Collections.emptyList() } } diff --git a/compiler/testData/diagnostics/tests/inference/publicApproximation/chainedLambdas.kt b/compiler/testData/diagnostics/tests/inference/publicApproximation/chainedLambdas.kt index fa18f6f31af..f38d9cfd30b 100644 --- a/compiler/testData/diagnostics/tests/inference/publicApproximation/chainedLambdas.kt +++ b/compiler/testData/diagnostics/tests/inference/publicApproximation/chainedLambdas.kt @@ -28,6 +28,6 @@ fun chained2(arg: First) = run { } fun test(arg: First) { - chained1(arg).first() - chained2(arg).first() + chained1(arg).first() + chained2(arg).first() } diff --git a/compiler/testData/diagnostics/tests/inference/publicApproximation/intersectionAfterSmartCastInLambdaReturn.kt b/compiler/testData/diagnostics/tests/inference/publicApproximation/intersectionAfterSmartCastInLambdaReturn.kt index 2ce11620656..f80465a4f3c 100644 --- a/compiler/testData/diagnostics/tests/inference/publicApproximation/intersectionAfterSmartCastInLambdaReturn.kt +++ b/compiler/testData/diagnostics/tests/inference/publicApproximation/intersectionAfterSmartCastInLambdaReturn.kt @@ -16,11 +16,11 @@ fun intersect(vararg elements: S): S = TODO() fun intersectAfterSmartCast(arg: Base, arg2: Base) = intersect( run { if (arg !is One) throw Exception() - arg + arg }, run { if (arg2 !is Two) throw Exception() - arg2 + arg2 } ) @@ -32,6 +32,6 @@ fun intersectArgWithSmartCastFromLambda(arg: One, arg2: Base) = argOrFn(arg) { } fun test() { - intersectAfterSmartCast(O1, O2).base() - intersectArgWithSmartCastFromLambda(O1, O2).base() + intersectAfterSmartCast(O1, O2).base() + intersectArgWithSmartCastFromLambda(O1, O2).base() } diff --git a/compiler/testData/diagnostics/tests/inference/publicApproximation/smartCastInLambdaReturnAfterIntersection.kt b/compiler/testData/diagnostics/tests/inference/publicApproximation/smartCastInLambdaReturnAfterIntersection.kt index d0a9c08ebef..d0bc3b701a7 100644 --- a/compiler/testData/diagnostics/tests/inference/publicApproximation/smartCastInLambdaReturnAfterIntersection.kt +++ b/compiler/testData/diagnostics/tests/inference/publicApproximation/smartCastInLambdaReturnAfterIntersection.kt @@ -17,5 +17,5 @@ fun smartCastAfterIntersection(a: One, b: Two) = run { } fun test(one: One, two: Two) { - smartCastAfterIntersection(one, two)?.base() + smartCastAfterIntersection(one, two)?.base() } diff --git a/compiler/testData/diagnostics/tests/inference/publicApproximation/twoIntersections.kt b/compiler/testData/diagnostics/tests/inference/publicApproximation/twoIntersections.kt index 80f4c89adb3..ec9ec9090d1 100644 --- a/compiler/testData/diagnostics/tests/inference/publicApproximation/twoIntersections.kt +++ b/compiler/testData/diagnostics/tests/inference/publicApproximation/twoIntersections.kt @@ -20,5 +20,5 @@ fun intersectNoBound(vararg elements: S): S = TODO() fun some(a: One, b: Two, c: Three) = intersectNoBound(intersect(a, b), c) fun test(arg: Base, arg2: Base) { - some(O1, O2, O3).base() + some(O1, O2, O3).base() } diff --git a/compiler/testData/diagnostics/tests/inference/recursiveLocalFuns/localFactorial.kt b/compiler/testData/diagnostics/tests/inference/recursiveLocalFuns/localFactorial.kt index a198c606e42..37cc64d26fe 100644 --- a/compiler/testData/diagnostics/tests/inference/recursiveLocalFuns/localFactorial.kt +++ b/compiler/testData/diagnostics/tests/inference/recursiveLocalFuns/localFactorial.kt @@ -3,7 +3,7 @@ fun foo() { fun fact(n: Int) = { if (n > 0) { - fact(n - 1) * n + fact(n - 1) * n } else { 1 diff --git a/compiler/testData/diagnostics/tests/inference/recursiveLocalFuns/selfCall.kt b/compiler/testData/diagnostics/tests/inference/recursiveLocalFuns/selfCall.kt index c571f49e90b..096dda38711 100644 --- a/compiler/testData/diagnostics/tests/inference/recursiveLocalFuns/selfCall.kt +++ b/compiler/testData/diagnostics/tests/inference/recursiveLocalFuns/selfCall.kt @@ -2,8 +2,8 @@ fun foo() { fun bar1() = bar1() - fun bar2() = 1 + bar2() - fun bar3() = id(bar3()) + fun bar2() = 1 + bar2() + fun bar3() = id(bar3()) } fun id(x: T) = x diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt1127.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt1127.kt index 0b1dd4fb676..e4bb9c66a69 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt1127.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt1127.kt @@ -5,5 +5,5 @@ package d fun asList(t: T) : List? {} fun main() { - val list : List = asList("") + val list : List = asList("") } diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2200.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2200.kt index 9667f42ae6e..5d62895c8cd 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2200.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2200.kt @@ -5,7 +5,7 @@ package n import checkSubtype fun main() { - val a = array(array()) + val a = array(array()) val a0 : Array> = array(array()) val a1 = array(array()) checkSubtype>>(a1) diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2283.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2283.kt index 6fdebb43d85..4ebb50e9f2f 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2283.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2283.kt @@ -9,5 +9,5 @@ fun Foo.map(f: (A) -> B): Foo = object : Foo {} fun foo() { val l: Foo = object : Foo {} - val m: Foo = l.map { ppp -> 1 } + val m: Foo = l.map { ppp -> 1 } } diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2286.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2286.kt index 64f34a67432..e5379b9ed55 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2286.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2286.kt @@ -11,14 +11,14 @@ abstract class Buggy { } val anotherThree : Int - get() = coll.find{ it > 3 } // does not work here + get() = coll.find{ it > 3 } // does not work here val yetAnotherThree : Int - get() = coll.find({ v:Int -> v > 3 }) // neither here + get() = coll.find({ v:Int -> v > 3 }) // neither here val extendedGetter : Int get() { - return coll.find{ it > 3 } // not even here! + return coll.find{ it > 3 } // not even here! } } diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2445.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2445.kt index 12e244db875..94def98c406 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2445.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2445.kt @@ -3,7 +3,7 @@ package a fun main() { - test { + test { } } diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2741.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2741.kt index 389ea4200be..9f672dfae24 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2741.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2741.kt @@ -8,5 +8,5 @@ fun _arrayList(vararg values: T) : List = throw Exception() class _Pair(val a: A) fun test() { - _arrayList(_Pair(1))._sortBy { it -> xxx } + _arrayList(_Pair(1))._sortBy { it -> xxx } } diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2838.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2838.kt index 495577d6210..88f5b5daf04 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2838.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2838.kt @@ -7,7 +7,7 @@ fun bar(a: T, b: Map) = b.get(a) fun test(a: Int) { foo(a, null) - bar(a, null) + bar(a, null) } fun test1(a: Int) { foo(a, throw Exception()) diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2883.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2883.kt index 0c612239ea4..79d3783eddf 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2883.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2883.kt @@ -21,7 +21,7 @@ fun test() { doAction { bar(12) } - val u: Unit = bar(11) + val u: Unit = bar(11) } fun testWithoutInference(col: MutableCollection) { diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt32862_both.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt32862_both.kt index 395a604413b..e564499f040 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt32862_both.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt32862_both.kt @@ -11,5 +11,5 @@ fun G.foo(vararg values: V2) = build() fun forReference(ref: Any?) {} fun test() { - forReference(G::foo) + forReference(G::foo) } diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt32862_none.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt32862_none.kt index af1d8278f15..becb4a0a146 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt32862_none.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt32862_none.kt @@ -6,5 +6,5 @@ fun foo(i: Long) {} fun bar(f: (Boolean) -> Unit) {} fun test() { - bar(::foo) + bar(::foo) } diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt33629.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt33629.kt index 759bb1f9a02..a719a6f09d2 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt33629.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt33629.kt @@ -16,5 +16,5 @@ fun acquireIntervals(): List = TODO() fun main() { buildTree(acquireIntervals()) - ?: emptyList() + ?: emptyList() } diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt36342.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt36342.kt index 0a0b62c7b96..89a52b7fac3 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt36342.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt36342.kt @@ -1,11 +1,10 @@ - import java.lang.Exception fun id(arg: K): K = arg fun test() { id(unresolved)!! - unresolved!!!! + unresolved!!!! try { id(unresolved) } catch (e: Exception) { diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt36342_2.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt36342_2.kt index b384ff74f6c..cc26c8ff532 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt36342_2.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt36342_2.kt @@ -1,13 +1,12 @@ - fun id(arg: K): K = arg fun materialize(): M = TODO() fun test(b: Boolean) { - id(if (b) { + id(if (b) { id(unresolved) } else { - id( - materialize() + id( + materialize() ) }) } diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt731.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt731.kt index f1b25d7420a..1ea2b98d979 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt731.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt731.kt @@ -15,6 +15,6 @@ fun A.foo(x: (T)-> G): G { fun main() { val a = A(1) - val t: String = a.foo({p -> p}) + val t: String = a.foo({p -> p}) checkSubtype(t) } diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt742.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt742.kt index f2b4c58dc17..a2ebf359325 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt742.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt742.kt @@ -9,4 +9,4 @@ fun List.map1(f: (T)-> Q): List? = tail!!.map1(f) fun List.map2(f: (T)-> Q): List? = tail.sure().map2(f) -fun List.map3(f: (T)-> Q): List? = tail.sure<T>().map3(f) +fun List.map3(f: (T)-> Q): List? = tail.sure().map3(f) diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt832.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt832.kt index 38fb0c5550d..13e57f4df37 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt832.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt832.kt @@ -6,5 +6,5 @@ fun fooT2() : (t : T) -> T { } fun test() { - fooT2()(1) // here 1 should not be marked with an error + fooT2()(1) // here 1 should not be marked with an error } diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt948.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt948.kt index 2e9d2edba77..40a788a7ed1 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt948.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt948.kt @@ -12,7 +12,7 @@ fun emptyList() : List? = ArrayList() fun foo() { // type arguments shouldn't be required val l : List = emptyList()!! - val l1 = emptyList()!! + val l1 = emptyList()!! checkSubtype>(emptyList()!!) checkSubtype?>(emptyList()) diff --git a/compiler/testData/diagnostics/tests/inference/reportingImprovements/FunctionPlaceholder.kt b/compiler/testData/diagnostics/tests/inference/reportingImprovements/FunctionPlaceholder.kt index ddb429392ef..7855b17a013 100644 --- a/compiler/testData/diagnostics/tests/inference/reportingImprovements/FunctionPlaceholder.kt +++ b/compiler/testData/diagnostics/tests/inference/reportingImprovements/FunctionPlaceholder.kt @@ -6,11 +6,11 @@ fun foo(a: A) = a fun bar(f: (T) -> R) = f fun test() { - foo { it } - foo { x -> x} - foo { x: Int -> x} + foo { it } + foo { x -> x} + foo { x: Int -> x} - bar { it + 1 } - bar { x -> x + 1} + bar { it + 1 } + bar { x -> x + 1} bar { x: Int -> x + 1} } diff --git a/compiler/testData/diagnostics/tests/inference/reportingImprovements/cannotInferParameterTypeWithInference.kt b/compiler/testData/diagnostics/tests/inference/reportingImprovements/cannotInferParameterTypeWithInference.kt index 3272c3704a3..6f8d089028f 100644 --- a/compiler/testData/diagnostics/tests/inference/reportingImprovements/cannotInferParameterTypeWithInference.kt +++ b/compiler/testData/diagnostics/tests/inference/reportingImprovements/cannotInferParameterTypeWithInference.kt @@ -3,7 +3,7 @@ package aa fun foo(block: (T)-> R) = block fun test1() { - foo { + foo { x -> // here we have 'cannot infer parameter type' error 43 } diff --git a/compiler/testData/diagnostics/tests/inference/reportingImprovements/inferTypeFromUnresolvedArgument.kt b/compiler/testData/diagnostics/tests/inference/reportingImprovements/inferTypeFromUnresolvedArgument.kt index fd0ece028c8..eb7ab774259 100644 --- a/compiler/testData/diagnostics/tests/inference/reportingImprovements/inferTypeFromUnresolvedArgument.kt +++ b/compiler/testData/diagnostics/tests/inference/reportingImprovements/inferTypeFromUnresolvedArgument.kt @@ -7,6 +7,6 @@ fun test() { id2(unresolved, "foo") id2(unresolved, 42) - ret("foo") - ret(42) + ret("foo") + ret(42) } diff --git a/compiler/testData/diagnostics/tests/inference/reportingImprovements/subtypeForInvariantWithErrorGenerics.kt b/compiler/testData/diagnostics/tests/inference/reportingImprovements/subtypeForInvariantWithErrorGenerics.kt index fca19ac0b3f..882e484a57e 100644 --- a/compiler/testData/diagnostics/tests/inference/reportingImprovements/subtypeForInvariantWithErrorGenerics.kt +++ b/compiler/testData/diagnostics/tests/inference/reportingImprovements/subtypeForInvariantWithErrorGenerics.kt @@ -4,8 +4,8 @@ fun foo (f: ()->R, r: MutableList) = r.add(f()) fun bar (r: MutableList, f: ()->R) = r.add(f()) fun test() { - val a = foo({1}, arrayListOf("")) //no type inference error on 'arrayListOf' - val b = bar(arrayListOf(""), {1}) + val a = foo({1}, arrayListOf("")) //no type inference error on 'arrayListOf' + val b = bar(arrayListOf(""), {1}) } // from standard library diff --git a/compiler/testData/diagnostics/tests/inference/reportingImprovements/typeInferenceFailedOnComponentN.kt b/compiler/testData/diagnostics/tests/inference/reportingImprovements/typeInferenceFailedOnComponentN.kt index 01c63bbcf7e..3b974696335 100644 --- a/compiler/testData/diagnostics/tests/inference/reportingImprovements/typeInferenceFailedOnComponentN.kt +++ b/compiler/testData/diagnostics/tests/inference/reportingImprovements/typeInferenceFailedOnComponentN.kt @@ -5,5 +5,5 @@ class X operator fun X.component1(): T = TODO() fun test() { - val (y) = X() + val (y) = X() } diff --git a/compiler/testData/diagnostics/tests/inference/reportingImprovements/typeInferenceFailedOnIteratorCall.kt b/compiler/testData/diagnostics/tests/inference/reportingImprovements/typeInferenceFailedOnIteratorCall.kt index ea73d04b5ae..88c7785527a 100644 --- a/compiler/testData/diagnostics/tests/inference/reportingImprovements/typeInferenceFailedOnIteratorCall.kt +++ b/compiler/testData/diagnostics/tests/inference/reportingImprovements/typeInferenceFailedOnIteratorCall.kt @@ -3,6 +3,6 @@ class X operator fun X.iterator(): Iterable = TODO() fun test() { - for (i in X()) { + for (i in X()) { } } diff --git a/compiler/testData/diagnostics/tests/inference/typeConstructorMismatch.kt b/compiler/testData/diagnostics/tests/inference/typeConstructorMismatch.kt index 5e342cc3707..b70d2209b16 100644 --- a/compiler/testData/diagnostics/tests/inference/typeConstructorMismatch.kt +++ b/compiler/testData/diagnostics/tests/inference/typeConstructorMismatch.kt @@ -4,9 +4,9 @@ package typeConstructorMismatch import java.util.* fun test(set: Set) { - elemAndList("2", set) + elemAndList("2", set) - "".elemAndListWithReceiver("", set) + "".elemAndListWithReceiver("", set) } fun elemAndList(r: R, t: List): R = r diff --git a/compiler/testData/diagnostics/tests/inference/typeInferenceExpectedTypeMismatch.kt b/compiler/testData/diagnostics/tests/inference/typeInferenceExpectedTypeMismatch.kt index 631ba119c38..bb52ba6584f 100644 --- a/compiler/testData/diagnostics/tests/inference/typeInferenceExpectedTypeMismatch.kt +++ b/compiler/testData/diagnostics/tests/inference/typeInferenceExpectedTypeMismatch.kt @@ -3,7 +3,7 @@ package typeInferenceExpectedTypeMismatch import java.util.* fun test() { - val s : Set = newList() + val s : Set = newList() use(s) } @@ -25,16 +25,16 @@ fun foo(o: Out, i: In): Two = throw Exception("$o $i") fun test1(outA: Out, inB: In) { foo(outA, inB) - val b: Two = foo(outA, inB) + val b: Two = foo(outA, inB) use(b) } fun bar(o: Out, i: In): Two = throw Exception("$o $i") fun test2(outA: Out, inC: In) { - bar(outA, inC) + bar(outA, inC) - val b: Two = bar(outA, inC) + val b: Two = bar(outA, inC) use(b) } diff --git a/compiler/testData/diagnostics/tests/inference/upperBounds/doNotInferFromBoundsOnly.kt b/compiler/testData/diagnostics/tests/inference/upperBounds/doNotInferFromBoundsOnly.kt index 31dfbeb5d86..ec39ce009e7 100644 --- a/compiler/testData/diagnostics/tests/inference/upperBounds/doNotInferFromBoundsOnly.kt +++ b/compiler/testData/diagnostics/tests/inference/upperBounds/doNotInferFromBoundsOnly.kt @@ -5,7 +5,7 @@ interface A fun emptyList(): List = throw Exception() fun test1() { - emptyList() + emptyList() } //-------------- @@ -13,7 +13,7 @@ fun test1() { fun emptyListOfA(): List = throw Exception() fun test2() { - emptyListOfA() + emptyListOfA() } //-------------- @@ -21,7 +21,7 @@ fun test2() { fun emptyStrangeMap(): Map = throw Exception() fun test3() { - emptyStrangeMap() + emptyStrangeMap() } //-------------- diff --git a/compiler/testData/diagnostics/tests/inference/upperBounds/intersectUpperBounds.kt b/compiler/testData/diagnostics/tests/inference/upperBounds/intersectUpperBounds.kt index 3b489f54847..2307f85ecdd 100644 --- a/compiler/testData/diagnostics/tests/inference/upperBounds/intersectUpperBounds.kt +++ b/compiler/testData/diagnostics/tests/inference/upperBounds/intersectUpperBounds.kt @@ -14,7 +14,7 @@ fun foo(in1: In, in2: In): T = throw Exception("$in1 $in2") fun test(inA: In, inB: In, inC: In) { - foo(inA, inB) + foo(inA, inB) val r = foo(inA, inC) checkSubtype(r) diff --git a/compiler/testData/diagnostics/tests/inference/upperBounds/useBoundsToInferTypeParamsSimple.kt b/compiler/testData/diagnostics/tests/inference/upperBounds/useBoundsToInferTypeParamsSimple.kt index fc9857f5a39..b1a67497700 100644 --- a/compiler/testData/diagnostics/tests/inference/upperBounds/useBoundsToInferTypeParamsSimple.kt +++ b/compiler/testData/diagnostics/tests/inference/upperBounds/useBoundsToInferTypeParamsSimple.kt @@ -15,7 +15,7 @@ fun checkItIsExactlyAny(t: T, l: MutableList) {} fun baz(v: V, u: MutableSet) = u fun test(a: Any, s: MutableSet) { - baz(a, s) + baz(a, s) } //from standard library diff --git a/compiler/testData/diagnostics/tests/infos/SmartCasts.kt b/compiler/testData/diagnostics/tests/infos/SmartCasts.kt index 95b6e033051..8cfa8ef21fb 100644 --- a/compiler/testData/diagnostics/tests/infos/SmartCasts.kt +++ b/compiler/testData/diagnostics/tests/infos/SmartCasts.kt @@ -88,17 +88,17 @@ fun f13(a : A?) { } else { a?.foo() - c.bar() + c.bar() } a?.foo() if (!(a is B)) { a?.foo() - c.bar() + c.bar() } else { a.foo() - c.bar() + c.bar() } a?.foo() @@ -108,7 +108,7 @@ fun f13(a : A?) { } else { a?.foo() - c.bar() + c.bar() } if (!(a is B) || !(a is C)) { @@ -201,7 +201,7 @@ fun mergeSmartCasts(a: Any?) { val i: Int = a.compareTo("") } if (a is String && a.compareTo("") == 0) {} - if (a is String || a.compareTo("") == 0) {} + if (a is String || a.compareTo("") == 0) {} } //mutability diff --git a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/lambdaAsGeneric.kt b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/lambdaAsGeneric.kt index 35593279205..d74277e2e0d 100644 --- a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/lambdaAsGeneric.kt +++ b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/lambdaAsGeneric.kt @@ -1,6 +1,5 @@ - fun box() : String { - test { + test { return@box "123" } diff --git a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/genericNestedClass.kt b/compiler/testData/diagnostics/tests/inner/qualifiedExpression/genericNestedClass.kt index 1f9b03b0354..7e430229e0a 100644 --- a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/genericNestedClass.kt +++ b/compiler/testData/diagnostics/tests/inner/qualifiedExpression/genericNestedClass.kt @@ -4,6 +4,6 @@ class Outer { } fun nested() = Outer.Nested() -fun noArguments() = Outer.Nested() +fun noArguments() = Outer.Nested() fun noArgumentsExpectedType(): Outer.Nested = Outer.Nested() fun manyArguments() = Outer.Nested() diff --git a/compiler/testData/diagnostics/tests/j+k/genericConstructor/classTypeParameterInferredFromArgument.kt b/compiler/testData/diagnostics/tests/j+k/genericConstructor/classTypeParameterInferredFromArgument.kt index 9087463f034..49b1cdaf171 100644 --- a/compiler/testData/diagnostics/tests/j+k/genericConstructor/classTypeParameterInferredFromArgument.kt +++ b/compiler/testData/diagnostics/tests/j+k/genericConstructor/classTypeParameterInferredFromArgument.kt @@ -8,7 +8,7 @@ public class A { // FILE: main.kt fun test(x: List, y: List) { - A("", x) checkType { _>() } + A("", x) checkType { _>() } A("", y) checkType { _>() } A("", x) diff --git a/compiler/testData/diagnostics/tests/j+k/genericConstructor/innerClass.kt b/compiler/testData/diagnostics/tests/j+k/genericConstructor/innerClass.kt index 8f9c486a20f..0b96d957b2c 100644 --- a/compiler/testData/diagnostics/tests/j+k/genericConstructor/innerClass.kt +++ b/compiler/testData/diagnostics/tests/j+k/genericConstructor/innerClass.kt @@ -12,6 +12,6 @@ fun test(x: List, y: List) { Outer().Inner("", y, 1) checkType { _.Inner>() } Outer().Inner("", y, 1) checkType { _.Inner>() } - Outer().Inner("", x, 1) checkType { _.Inner>() } + Outer().Inner("", x, 1) checkType { _.Inner>() } Outer().Inner("", x, 1) } diff --git a/compiler/testData/diagnostics/tests/j+k/genericConstructor/noClassTypeParametersInvParameter.kt b/compiler/testData/diagnostics/tests/j+k/genericConstructor/noClassTypeParametersInvParameter.kt index 95a10a3920f..d9b8943e60f 100644 --- a/compiler/testData/diagnostics/tests/j+k/genericConstructor/noClassTypeParametersInvParameter.kt +++ b/compiler/testData/diagnostics/tests/j+k/genericConstructor/noClassTypeParametersInvParameter.kt @@ -9,7 +9,7 @@ public class A { class Inv fun test(x: Inv, y: Inv) { - A("", x) + A("", x) A("", y) A("", x) diff --git a/compiler/testData/diagnostics/tests/j+k/genericConstructor/recursive.kt b/compiler/testData/diagnostics/tests/j+k/genericConstructor/recursive.kt index 3a68bcaef9e..86affa593ef 100644 --- a/compiler/testData/diagnostics/tests/j+k/genericConstructor/recursive.kt +++ b/compiler/testData/diagnostics/tests/j+k/genericConstructor/recursive.kt @@ -8,4 +8,4 @@ public class C { // FILE: main.kt -fun foo() = C() +fun foo() = C() diff --git a/compiler/testData/diagnostics/tests/j+k/genericConstructor/superCall.kt b/compiler/testData/diagnostics/tests/j+k/genericConstructor/superCall.kt index 936fd195aaf..f88f3aadb01 100644 --- a/compiler/testData/diagnostics/tests/j+k/genericConstructor/superCall.kt +++ b/compiler/testData/diagnostics/tests/j+k/genericConstructor/superCall.kt @@ -9,9 +9,9 @@ public class A { // FILE: main.kt class B1(x: List) : A("", x) -class B2(x: List) : A("", x) +class B2(x: List) : A("", x) class C : A { constructor(x: List) : super("", x) - constructor(x: List, y: Int) : super("", x) + constructor(x: List, y: Int) : super("", x) } diff --git a/compiler/testData/diagnostics/tests/j+k/genericConstructor/superCallImpossibleToInfer.kt b/compiler/testData/diagnostics/tests/j+k/genericConstructor/superCallImpossibleToInfer.kt index 573a1bfb21d..e2498cc3a51 100644 --- a/compiler/testData/diagnostics/tests/j+k/genericConstructor/superCallImpossibleToInfer.kt +++ b/compiler/testData/diagnostics/tests/j+k/genericConstructor/superCallImpossibleToInfer.kt @@ -11,10 +11,10 @@ public class A { // TODO: It's effectively impossible to perform super call to such constructor // if there is not enough information to infer corresponding arguments // May be we could add some special syntax for such arguments -class B1(x: List) : A("", x) -class B2(x: List) : A("", x) +class B1(x: List) : A("", x) +class B2(x: List) : A("", x) class C : A { - constructor(x: List) : super("", x) - constructor(x: List, y: Int) : super("", x) + constructor(x: List) : super("", x) + constructor(x: List, y: Int) : super("", x) } diff --git a/compiler/testData/diagnostics/tests/j+k/genericConstructorWithMultipleBounds.kt b/compiler/testData/diagnostics/tests/j+k/genericConstructorWithMultipleBounds.kt index b35b271babe..9f29b7052a7 100644 --- a/compiler/testData/diagnostics/tests/j+k/genericConstructorWithMultipleBounds.kt +++ b/compiler/testData/diagnostics/tests/j+k/genericConstructorWithMultipleBounds.kt @@ -10,8 +10,8 @@ public class J { import java.io.Serializable -fun cloneable(c: Cloneable) = J(c) +fun cloneable(c: Cloneable) = J(c) -fun serializable(s: Serializable) = J(s) +fun serializable(s: Serializable) = J(s) fun both(t: T) where T : Cloneable, T : Serializable = J(t) diff --git a/compiler/testData/diagnostics/tests/j+k/sam/enhancedSamConstructor.kt b/compiler/testData/diagnostics/tests/j+k/sam/enhancedSamConstructor.kt index 304f29bfd10..5d73a4d031b 100644 --- a/compiler/testData/diagnostics/tests/j+k/sam/enhancedSamConstructor.kt +++ b/compiler/testData/diagnostics/tests/j+k/sam/enhancedSamConstructor.kt @@ -15,12 +15,12 @@ public interface J2 extends J { // FILE: main.kt fun main() { - J { s: String -> s} // should be prohibited, because SAM value parameter has nullable type + J { s: String -> s} // should be prohibited, because SAM value parameter has nullable type J { "" + it.length } J { null } J { it?.length?.toString() } - J2 { s: String -> s} + J2 { s: String -> s} J2 { "" + it.length } J2 { null } J2 { it?.length?.toString() } diff --git a/compiler/testData/diagnostics/tests/j+k/wrongVarianceInJava.kt b/compiler/testData/diagnostics/tests/j+k/wrongVarianceInJava.kt index c7c0d347ef4..70543008bc0 100644 --- a/compiler/testData/diagnostics/tests/j+k/wrongVarianceInJava.kt +++ b/compiler/testData/diagnostics/tests/j+k/wrongVarianceInJava.kt @@ -19,5 +19,5 @@ class In { fun test() { A.foo().x() checkType { _() } - A.bar().y(null) + A.bar().y(null) } diff --git a/compiler/testData/diagnostics/tests/modifiers/const/arrayInAnnotationArgumentType.kt b/compiler/testData/diagnostics/tests/modifiers/const/arrayInAnnotationArgumentType.kt index 5be111bbe0a..048512d373a 100644 --- a/compiler/testData/diagnostics/tests/modifiers/const/arrayInAnnotationArgumentType.kt +++ b/compiler/testData/diagnostics/tests/modifiers/const/arrayInAnnotationArgumentType.kt @@ -1,2 +1,2 @@ -annotation class A(val a: IntArray = arrayOf(1)) +annotation class A(val a: IntArray = arrayOf(1)) annotation class B(val a: IntArray = intArrayOf(1)) diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classVsFunctionGenericsInParamsMismatch.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classVsFunctionGenericsInParamsMismatch.kt index dc2df929564..14586906ce5 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classVsFunctionGenericsInParamsMismatch.kt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classVsFunctionGenericsInParamsMismatch.kt @@ -31,6 +31,6 @@ fun test(b: B?, c: C) { b?.foo(1, 1) c.foo(1, 1) if (b is C) { - b?.foo(1, 1) + b?.foo(1, 1) } } diff --git a/compiler/testData/diagnostics/tests/multiplatform/namedArguments.kt b/compiler/testData/diagnostics/tests/multiplatform/namedArguments.kt index 40d0d70dca6..208487f3414 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/namedArguments.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/namedArguments.kt @@ -11,9 +11,9 @@ expect class Foo(zzz: Int) { expect fun f2(xxx: Int) fun testCommon() { - Foo(zzz = 0) - val f = Foo(aaa = true) - f.f1(xxx = "") + Foo(zzz = 0) + val f = Foo(aaa = true) + f.f1(xxx = "") f2(xxx = 42) } diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/AssertNotNull.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/AssertNotNull.kt index 54ec6a905b4..aa78719b947 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/AssertNotNull.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/AssertNotNull.kt @@ -34,5 +34,5 @@ fun main() { } val f : String = a!! - checkSubtype(a!!) + checkSubtype(a!!) } diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2216.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2216.kt index a3ef6f94083..6e84be5cd75 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2216.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2216.kt @@ -14,7 +14,7 @@ fun foo() { val y: Int? = 0 val z: Int? = 0 - bar(if (y != null) y else z, y) + bar(if (y != null) y else z, y) y + 2 baz(y, y, if (y == null) return else y, y) baz(y, z!!, z, y) diff --git a/compiler/testData/diagnostics/tests/nullableTypes/safeCallOnTypeWithNullableUpperBound.kt b/compiler/testData/diagnostics/tests/nullableTypes/safeCallOnTypeWithNullableUpperBound.kt index 219d05ab2ef..98814c13ba0 100644 --- a/compiler/testData/diagnostics/tests/nullableTypes/safeCallOnTypeWithNullableUpperBound.kt +++ b/compiler/testData/diagnostics/tests/nullableTypes/safeCallOnTypeWithNullableUpperBound.kt @@ -9,5 +9,5 @@ fun T.testThis(): String? { if (this != null) { return this?.toString() } - return this?.toString() + return this?.toString() } diff --git a/compiler/testData/diagnostics/tests/numbers/characterIsNotANumber.kt b/compiler/testData/diagnostics/tests/numbers/characterIsNotANumber.kt index 03a89ca0fd5..534bb0f626a 100644 --- a/compiler/testData/diagnostics/tests/numbers/characterIsNotANumber.kt +++ b/compiler/testData/diagnostics/tests/numbers/characterIsNotANumber.kt @@ -7,5 +7,5 @@ fun test() { foo(c) val d: Char? = 'd' - foo(d!!) + foo(d!!) } diff --git a/compiler/testData/diagnostics/tests/numbers/doublesInSimpleConstraints.kt b/compiler/testData/diagnostics/tests/numbers/doublesInSimpleConstraints.kt index f59be6be1fa..1aec135e0ca 100644 --- a/compiler/testData/diagnostics/tests/numbers/doublesInSimpleConstraints.kt +++ b/compiler/testData/diagnostics/tests/numbers/doublesInSimpleConstraints.kt @@ -20,5 +20,5 @@ fun test() { val d = either(11, 2.3) checkSubtype(d) - val e: Float = id(1) + val e: Float = id(1) } diff --git a/compiler/testData/diagnostics/tests/numbers/intValuesOutOfRange.kt b/compiler/testData/diagnostics/tests/numbers/intValuesOutOfRange.kt index 4f87a343ddf..d3a34f31636 100644 --- a/compiler/testData/diagnostics/tests/numbers/intValuesOutOfRange.kt +++ b/compiler/testData/diagnostics/tests/numbers/intValuesOutOfRange.kt @@ -12,5 +12,5 @@ fun main() { //not 'An integer literal does not conform to the expected type Int/Long' val l: Long = 1111111111111117777777777777777 foo(11111111111111177777777777777) - bar(11111111111111177777777777777) + bar(11111111111111177777777777777) } diff --git a/compiler/testData/diagnostics/tests/numbers/numbersInSimpleConstraints.kt b/compiler/testData/diagnostics/tests/numbers/numbersInSimpleConstraints.kt index f5574644cd0..642b0809528 100644 --- a/compiler/testData/diagnostics/tests/numbers/numbersInSimpleConstraints.kt +++ b/compiler/testData/diagnostics/tests/numbers/numbersInSimpleConstraints.kt @@ -16,9 +16,9 @@ fun otherGeneric(l: List) {} fun test() { val a: Byte = id(1) - val b: Byte = id(300) + val b: Byte = id(300) - val c: Int = id(9223372036854775807) + val c: Int = id(9223372036854775807) val d = id(22) checkSubtype(d) @@ -28,14 +28,14 @@ fun test() { val f: Byte = either(1, 2) - val g: Byte = either(1, 300) + val g: Byte = either(1, 300) other(11) - otherGeneric(1) + otherGeneric(1) val r = either(1, "") - r checkType { _() } + r checkType { _() } use(a, b, c, d, e, f, g, r) } @@ -47,7 +47,7 @@ interface Inv fun exactBound(t: T, l: Inv): T = throw Exception("$t $l") fun testExactBound(invS: Inv, invI: Inv, invB: Inv) { - exactBound(1, invS) + exactBound(1, invS) exactBound(1, invI) val b = exactBound(1, invB) @@ -60,7 +60,7 @@ fun lowerBound(t: T, l : Cov): T = throw Exception("$t $l") fun testLowerBound(cov: Cov, covN: Cov) { val r = lowerBound(1, cov) - r checkType { _() } + r checkType { _() } val n = lowerBound(1, covN) n checkType { _() } @@ -71,7 +71,7 @@ interface Contr fun upperBound(t: T, l: Contr): T = throw Exception("$t $l") fun testUpperBound(contrS: Contr, contrB: Contr, contrN: Contr) { - upperBound(1, contrS) + upperBound(1, contrS) val n = upperBound(1, contrN) n checkType { _() } diff --git a/compiler/testData/diagnostics/tests/operatorsOverloading/kt11300.kt b/compiler/testData/diagnostics/tests/operatorsOverloading/kt11300.kt index a46a695d85a..cb285d5e90a 100644 --- a/compiler/testData/diagnostics/tests/operatorsOverloading/kt11300.kt +++ b/compiler/testData/diagnostics/tests/operatorsOverloading/kt11300.kt @@ -1,4 +1,3 @@ - class A { operator fun get(x: Int): Int = x fun set(x: Int, y: Int) {} // no `operator` modifier @@ -6,7 +5,7 @@ class A { fun main() { val a = A() - a[1]++ - a[1] += 3 + a[1]++ + a[1] += 3 a[1] = a[1] + 3 } diff --git a/compiler/testData/diagnostics/tests/operatorsOverloading/kt13330.kt b/compiler/testData/diagnostics/tests/operatorsOverloading/kt13330.kt index f15c3745d4b..8c216b41b5a 100644 --- a/compiler/testData/diagnostics/tests/operatorsOverloading/kt13330.kt +++ b/compiler/testData/diagnostics/tests/operatorsOverloading/kt13330.kt @@ -1,3 +1,3 @@ //KT-13330 AssertionError: Illegal resolved call to variable with invoke -fun foo(exec: (String.() -> Unit)?) = "".exec<caret>() // is test data tag here +fun foo(exec: (String.() -> Unit)?) = "".exec<caret>() // is test data tag here diff --git a/compiler/testData/diagnostics/tests/overload/kt2493.kt b/compiler/testData/diagnostics/tests/overload/kt2493.kt index 17d6b03bbf9..6e72ebd2b2e 100644 --- a/compiler/testData/diagnostics/tests/overload/kt2493.kt +++ b/compiler/testData/diagnostics/tests/overload/kt2493.kt @@ -15,5 +15,5 @@ class C: A, B fun main() { AImpl().f() BImpl().f() - C().f() + C().f() } diff --git a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/withNothing.kt b/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/withNothing.kt index ae03227f7a7..a3744cddf8f 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/withNothing.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/withNothing.kt @@ -22,5 +22,5 @@ fun out(t: T): Out> = null!! fun test(a: Out, b: Out>) { val v = f(a, b, out(J.j())) v checkType { _>() } - v checkType { _>() } + v checkType { _>() } } diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/singleton.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/singleton.kt index c3ce3e75b6b..5476ab5b5c6 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/singleton.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/methodCall/singleton.kt @@ -4,6 +4,6 @@ interface Foo fun test() { var nullable: Foo? = null - val foo: Collection = java.util.Collections.singleton(nullable) + val foo: Collection = java.util.Collections.singleton(nullable) val foo1: Collection = java.util.Collections.singleton(nullable!!) } diff --git a/compiler/testData/diagnostics/tests/platformTypes/notNullTypeParameter/methodTypeParameter.kt b/compiler/testData/diagnostics/tests/platformTypes/notNullTypeParameter/methodTypeParameter.kt index 5b16e5c9bfa..cec0554560c 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/notNullTypeParameter/methodTypeParameter.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/notNullTypeParameter/methodTypeParameter.kt @@ -10,9 +10,9 @@ public class A { // FILE: k.kt fun test() { - A.bar(null, "") + A.bar(null, "") A.bar(null, "") A.bar(null, "") - A.bar(null, A.platformString()) + A.bar(null, A.platformString()) } diff --git a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/samRaw.kt b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/samRaw.kt index c6653eac642..c0f9db1c7b8 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/samRaw.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/samRaw.kt @@ -20,7 +20,7 @@ class B { fun main() { fun println() {} // All parameters in SAM adapter of `foo` have functional types - B().foo({ println() }, B.bar()) + B().foo({ println() }, B.bar()) // So you should use SAM constructors when you want to use mix lambdas and Java objects B().foo(Runnable { println() }, B.bar()) B().foo({ println() }, { it: Any? -> it == null } ) diff --git a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/cantBeInferred.kt b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/cantBeInferred.kt index 50b2d297578..612e6cd04b8 100644 --- a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/cantBeInferred.kt +++ b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/cantBeInferred.kt @@ -1,6 +1,6 @@ // NI_EXPECTED_FILE -val x get() = foo() -val y get() = bar() +val x get() = foo() +val y get() = bar() fun foo(): E = null!! fun bar(): List = null!! diff --git a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/objectExpression.kt b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/objectExpression.kt index 8e707b06ff6..4912c8201d2 100644 --- a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/objectExpression.kt +++ b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/objectExpression.kt @@ -6,7 +6,7 @@ object Outer { get() = 0 override fun get(index: Int): Char { - checkSubtype(x) + checkSubtype(x) return ' ' } diff --git a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/recursiveGetter.kt b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/recursiveGetter.kt index 8da2453ec26..3c28e0cee61 100644 --- a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/recursiveGetter.kt +++ b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/recursiveGetter.kt @@ -1,16 +1,16 @@ // !CHECK_TYPE // NI_EXPECTED_FILE -val x get() = x +val x get() = x class A { - val y get() = y + val y get() = y val a get() = b - val b get() = a + val b get() = a - val z1 get() = id(z1) - val z2 get() = l(z2) + val z1 get() = id(z1) + val z2 get() = l(z2) val u get() = field } diff --git a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/unsupportedInferenceFromGetters.kt b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/unsupportedInferenceFromGetters.kt index fdce8c4da00..dcda83cf847 100644 --- a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/unsupportedInferenceFromGetters.kt +++ b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/unsupportedInferenceFromGetters.kt @@ -7,8 +7,8 @@ } // cantBeInferred.kt -val x1 get() = foo() -val y1 get() = bar() +val x1 get() = foo() +val y1 get() = bar() fun foo(): E = null!! fun bar(): List = null!! @@ -42,7 +42,7 @@ fun l(x: E): List = null!! } // recursive -val x4 get() = x4 +val x4 get() = x4 // null as nothing val x5 get() = null diff --git a/compiler/testData/diagnostics/tests/qualifiedExpression/TypeWithError.kt b/compiler/testData/diagnostics/tests/qualifiedExpression/TypeWithError.kt index b2e09756ffe..c6c34353adb 100644 --- a/compiler/testData/diagnostics/tests/qualifiedExpression/TypeWithError.kt +++ b/compiler/testData/diagnostics/tests/qualifiedExpression/TypeWithError.kt @@ -16,16 +16,16 @@ fun test1(a: A.B.): A.B. { fun test2(a: A.e.C): A.e.C { val aa: A.e.C = null!! -} +} fun test3(a: a.A.C): a.A.C { val aa: a.A.C = null!! -} +} fun test4(a: A.B.ee): A.B.ee { val aa: A.B.ee = null!! -} +} fun test5(a: A.ee): A.ee { val aa: A.ee = null!! -} +} diff --git a/compiler/testData/diagnostics/tests/qualifiedExpression/calleeExpressionAsCallExpression.kt b/compiler/testData/diagnostics/tests/qualifiedExpression/calleeExpressionAsCallExpression.kt index 2fb84b035c7..8572c5024fb 100644 --- a/compiler/testData/diagnostics/tests/qualifiedExpression/calleeExpressionAsCallExpression.kt +++ b/compiler/testData/diagnostics/tests/qualifiedExpression/calleeExpressionAsCallExpression.kt @@ -1 +1 @@ -val unwrapped = some<sdf()()Any>::unwrap +val unwrapped = some<sdf()()Any>::unwrap diff --git a/compiler/testData/diagnostics/tests/qualifiedExpression/nullCalleeExpression.kt b/compiler/testData/diagnostics/tests/qualifiedExpression/nullCalleeExpression.kt index 9f5270292cf..3e1d5fce80b 100644 --- a/compiler/testData/diagnostics/tests/qualifiedExpression/nullCalleeExpression.kt +++ b/compiler/testData/diagnostics/tests/qualifiedExpression/nullCalleeExpression.kt @@ -1,3 +1,3 @@ // NI_EXPECTED_FILE -val unwrapped = some.<cabc$WrapperAny>::unwrap +val unwrapped = some.<cabc$WrapperAny>::unwrap diff --git a/compiler/testData/diagnostics/tests/recovery/absentLeftHandSide.kt b/compiler/testData/diagnostics/tests/recovery/absentLeftHandSide.kt index 65a0b43d879..dcfcf5f8f42 100644 --- a/compiler/testData/diagnostics/tests/recovery/absentLeftHandSide.kt +++ b/compiler/testData/diagnostics/tests/recovery/absentLeftHandSide.kt @@ -7,9 +7,9 @@ fun composite() { } fun html() { - <html></html> + <html></html> } fun html1() { - <html></html>html + <html></html>html } diff --git a/compiler/testData/diagnostics/tests/regressions/Jet81.kt b/compiler/testData/diagnostics/tests/regressions/Jet81.kt index a6663d65dd2..8692deeaf17 100644 --- a/compiler/testData/diagnostics/tests/regressions/Jet81.kt +++ b/compiler/testData/diagnostics/tests/regressions/Jet81.kt @@ -3,7 +3,7 @@ class Test { private val y = object { - val a = y; + val a = y; } val z = y.a; @@ -17,12 +17,12 @@ object A { class Test2 { private val a = object { init { - b + 1 + b + 1 } val x = b val y = 1 } - val b = a.x + val b = a.x val c = a.y } diff --git a/compiler/testData/diagnostics/tests/regressions/correctResultSubstitutorForErrorCandidate.kt b/compiler/testData/diagnostics/tests/regressions/correctResultSubstitutorForErrorCandidate.kt index 3cf1f5044ff..9613fd9b519 100644 --- a/compiler/testData/diagnostics/tests/regressions/correctResultSubstitutorForErrorCandidate.kt +++ b/compiler/testData/diagnostics/tests/regressions/correctResultSubstitutorForErrorCandidate.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER fun test(a: Int, b: Boolean) { - bar(a.foo(b)) + bar(a.foo(b)) } fun T.foo(l: (T) -> R): R = TODO() diff --git a/compiler/testData/diagnostics/tests/regressions/ea72837.kt b/compiler/testData/diagnostics/tests/regressions/ea72837.kt index 80a9e4777bb..93fd484cbfe 100644 --- a/compiler/testData/diagnostics/tests/regressions/ea72837.kt +++ b/compiler/testData/diagnostics/tests/regressions/ea72837.kt @@ -3,7 +3,7 @@ fun g(x: T) = 1 fun h(x: () -> Unit) = 1 fun foo() { - f(::) - g(::) + f(::) + g(::) h(::) } diff --git a/compiler/testData/diagnostics/tests/regressions/itselfAsUpperBoundLocal.kt b/compiler/testData/diagnostics/tests/regressions/itselfAsUpperBoundLocal.kt index 31f6359da71..99faa91ad63 100644 --- a/compiler/testData/diagnostics/tests/regressions/itselfAsUpperBoundLocal.kt +++ b/compiler/testData/diagnostics/tests/regressions/itselfAsUpperBoundLocal.kt @@ -1,4 +1,4 @@ fun bar() { fun <T: T?> foo() {} - foo() + foo() } diff --git a/compiler/testData/diagnostics/tests/regressions/kt10243.kt b/compiler/testData/diagnostics/tests/regressions/kt10243.kt index c5f5ce0b938..6d84de26566 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt10243.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt10243.kt @@ -3,9 +3,9 @@ private fun doUpdateRegularTasks() { try { while (f) { val xmlText = getText() - if (xmlText == null) {} + if (xmlText == null) {} else { - xmlText.value = 0 // !!! + xmlText.value = 0 // !!! } } diff --git a/compiler/testData/diagnostics/tests/regressions/kt10843.kt b/compiler/testData/diagnostics/tests/regressions/kt10843.kt index 797327290cb..50a313b667b 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt10843.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt10843.kt @@ -1,7 +1,7 @@ // NI_EXPECTED_FILE // See EA-76890 / KT-10843: NPE during analysis -fun lambda(x : Int?) = x?.let l { +fun lambda(x : Int?) = x?.let l { y -> - if (y > 0) return@l x + if (y > 0) return@l x y }!! diff --git a/compiler/testData/diagnostics/tests/regressions/kt11979.kt b/compiler/testData/diagnostics/tests/regressions/kt11979.kt index aca2c7e8184..4d137bb0afe 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt11979.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt11979.kt @@ -16,7 +16,7 @@ class Foo>(val f: F) fun id(t1: T, t2: T) = t2 fun test(foo: Foo<*>, g: Bar<*>) { - id(foo.f, g).t.t + id(foo.f, g).t.t } fun main() { diff --git a/compiler/testData/diagnostics/tests/regressions/kt12898.kt b/compiler/testData/diagnostics/tests/regressions/kt12898.kt index 8e77087ea6c..6171b0fdf6c 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt12898.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt12898.kt @@ -7,9 +7,9 @@ interface B { class C(override val t: Any?) : B fun f(b: B<*, Any>) { - val y = b.t - if (y is String?) { - y.length + val y = b.t + if (y is String?) { + y.length } } diff --git a/compiler/testData/diagnostics/tests/regressions/kt13685.kt b/compiler/testData/diagnostics/tests/regressions/kt13685.kt index baef6a303b4..c2fb19d48f7 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt13685.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt13685.kt @@ -2,5 +2,5 @@ fun foo() { val text: List = null!! - text.map Any?::toString + text.map Any?::toString } diff --git a/compiler/testData/diagnostics/tests/regressions/kt1489_1728.kt b/compiler/testData/diagnostics/tests/regressions/kt1489_1728.kt index f15bdb3d45e..91a46a457cc 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt1489_1728.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt1489_1728.kt @@ -18,7 +18,7 @@ class C { fun p() : Resource? = null fun bar() { - foo(p()) { + foo(p()) { } } diff --git a/compiler/testData/diagnostics/tests/regressions/kt24488.kt b/compiler/testData/diagnostics/tests/regressions/kt24488.kt index 09e9fea9cea..4755c64c698 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt24488.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt24488.kt @@ -4,7 +4,7 @@ class Bar { val a: Array? = null } -fun foo(bar: Bar) = bar.a?.asIterable() ?: emptyArray() +fun foo(bar: Bar) = bar.a?.asIterable() ?: emptyArray() fun Array.asIterable(): Iterable = TODO() diff --git a/compiler/testData/diagnostics/tests/regressions/kt312.kt b/compiler/testData/diagnostics/tests/regressions/kt312.kt index 10975743dc2..6dd7cf4b27e 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt312.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt312.kt @@ -5,5 +5,5 @@ fun Array.safeGet(index : Int) : T? { } val args : Array = Array(1, {""}) -val name : String = args.safeGet(0) // No error, must be type mismatch +val name : String = args.safeGet(0) // No error, must be type mismatch val name1 : String? = args.safeGet(0) diff --git a/compiler/testData/diagnostics/tests/regressions/kt328.kt b/compiler/testData/diagnostics/tests/regressions/kt328.kt index 0b29be62287..935ebe7670f 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt328.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt328.kt @@ -12,18 +12,17 @@ fun bar2() = { //properties //in a class class A() { - val x = { x } + val x = { x } } //in a package -val x = { x } +val x = { x } //KT-787 AssertionError on code 'val x = x' -val z = z +val z = z //KT-329 Assertion failure on local function fun block(f : () -> Unit) = f() fun bar3() = block{ foo3() // <-- missing closing curly bracket fun foo3() = block{ bar3() } - diff --git a/compiler/testData/diagnostics/tests/regressions/kt353.kt b/compiler/testData/diagnostics/tests/regressions/kt353.kt index adb137b882d..4ebfe1e457c 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt353.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt353.kt @@ -12,7 +12,7 @@ fun foo(a: A) { val u: Unit = a.gen() // Unit should be inferred if (true) { - a.gen() // Shouldn't work: no info for inference + a.gen() // Shouldn't work: no info for inference } val b : () -> Unit = { @@ -28,5 +28,5 @@ fun foo(a: A) { a.gen() //type mismatch, but Int can be derived } - a.gen() // Shouldn't work: no info for inference + a.gen() // Shouldn't work: no info for inference } diff --git a/compiler/testData/diagnostics/tests/regressions/kt557.kt b/compiler/testData/diagnostics/tests/regressions/kt557.kt index 3f8fec24bb6..d34f5a7b580 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt557.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt557.kt @@ -7,5 +7,5 @@ fun Array.length() : Int { } fun test(array : Array?) { - array?.sure>().length() + array?.sure>().length() } diff --git a/compiler/testData/diagnostics/tests/resolve/dslMarker/dslMarkerWithTypealiasRecursion.kt b/compiler/testData/diagnostics/tests/resolve/dslMarker/dslMarkerWithTypealiasRecursion.kt index 0448706e1a1..d4bf9f5efdc 100644 --- a/compiler/testData/diagnostics/tests/resolve/dslMarker/dslMarkerWithTypealiasRecursion.kt +++ b/compiler/testData/diagnostics/tests/resolve/dslMarker/dslMarkerWithTypealiasRecursion.kt @@ -12,12 +12,12 @@ typealias YBar = ZBar typealias ZBar = YBar fun Foo.foo(body: Foo.() -> Unit) = body() -fun Foo.zbar(body: ZBar.() -> Unit) = Bar().body() +fun Foo.zbar(body: ZBar.() -> Unit) = Bar().body() fun test() { Foo().foo { zbar { - foo {} + foo {} } } } diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/errors/ambiguityForInvoke.kt b/compiler/testData/diagnostics/tests/resolve/invoke/errors/ambiguityForInvoke.kt index 7f4d131807e..58f7aadd45c 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/errors/ambiguityForInvoke.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/errors/ambiguityForInvoke.kt @@ -1,10 +1,10 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER - + fun Int.invoke(i: Int, a: Any) {} fun Int.invoke(a: Any, i: Int) {} fun foo(i: Int) { - i(1, 1) + i(1, 1) - 5(1, 2) + 5(1, 2) } diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/errors/typeInferenceErrorForInvoke.kt b/compiler/testData/diagnostics/tests/resolve/invoke/errors/typeInferenceErrorForInvoke.kt index d82833dbd5a..8deb24a7166 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/errors/typeInferenceErrorForInvoke.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/errors/typeInferenceErrorForInvoke.kt @@ -7,7 +7,7 @@ operator fun T.invoke(a: A) {} fun foo(s: String, ai: A) { 1(ai) - s(ai) + s(ai) - ""(ai) + ""(ai) } diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/errors/unsafeCallWithInvoke.kt b/compiler/testData/diagnostics/tests/resolve/invoke/errors/unsafeCallWithInvoke.kt index 7cf9720bfb3..ff61573523e 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/errors/unsafeCallWithInvoke.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/errors/unsafeCallWithInvoke.kt @@ -5,5 +5,5 @@ operator fun String.invoke(i: Int) {} fun foo(s: String?) { s(1) - (s ?: null)(1) + (s ?: null)(1) } diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/errors/wrongReceiverForInvokeOnExpression.kt b/compiler/testData/diagnostics/tests/resolve/invoke/errors/wrongReceiverForInvokeOnExpression.kt index d5780d57811..a97e364f474 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/errors/wrongReceiverForInvokeOnExpression.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/errors/wrongReceiverForInvokeOnExpression.kt @@ -1,16 +1,15 @@ - fun test1() { - 1. (fun String.(i: Int) = i )(1) - 1.(label@ fun String.(i: Int) = i )(1) + 1. (fun String.(i: Int) = i )(1) + 1.(label@ fun String.(i: Int) = i )(1) } fun test2(f: String.(Int) -> Unit) { - 11.(f)(1) - 11.(f)() + 11.(f)(1) + 11.(f)() } fun test3() { fun foo(): String.(Int) -> Unit = {} - 1.(foo())(1) + 1.(foo())(1) } diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/extensionValueAsNonExtension.kt b/compiler/testData/diagnostics/tests/resolve/invoke/extensionValueAsNonExtension.kt index 8fd35158d2a..acc7042275d 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/extensionValueAsNonExtension.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/extensionValueAsNonExtension.kt @@ -18,5 +18,5 @@ fun foo(): A.() -> Int { val b: Int = foo()(A()) val c: Int = (foo())(A()) - return null!! + return null!! } diff --git a/compiler/testData/diagnostics/tests/resolve/kt36264.kt b/compiler/testData/diagnostics/tests/resolve/kt36264.kt index 1772355390e..ab4ec9489f7 100644 --- a/compiler/testData/diagnostics/tests/resolve/kt36264.kt +++ b/compiler/testData/diagnostics/tests/resolve/kt36264.kt @@ -11,7 +11,7 @@ class Cls { fun test(s: String) { if (s.ext is B) - take(s.ext) + take(s.ext) } } diff --git a/compiler/testData/diagnostics/tests/resolve/nestedCalls/completeTypeInferenceForNestedInNoneApplicable.kt b/compiler/testData/diagnostics/tests/resolve/nestedCalls/completeTypeInferenceForNestedInNoneApplicable.kt index dc52e245f20..0a6893c8b7d 100644 --- a/compiler/testData/diagnostics/tests/resolve/nestedCalls/completeTypeInferenceForNestedInNoneApplicable.kt +++ b/compiler/testData/diagnostics/tests/resolve/nestedCalls/completeTypeInferenceForNestedInNoneApplicable.kt @@ -4,7 +4,7 @@ fun foo(i: Int) = i fun foo(s: String) = s fun test() { - foo(emptyList()) + foo(emptyList()) } fun emptyList(): List {throw Exception()} diff --git a/compiler/testData/diagnostics/tests/resolve/nestedCalls/twoTypeParameters.kt b/compiler/testData/diagnostics/tests/resolve/nestedCalls/twoTypeParameters.kt index dd4f7d0b20c..74b8670b80a 100644 --- a/compiler/testData/diagnostics/tests/resolve/nestedCalls/twoTypeParameters.kt +++ b/compiler/testData/diagnostics/tests/resolve/nestedCalls/twoTypeParameters.kt @@ -10,7 +10,7 @@ public class ResolutionTaskHolder { tasks.add(ResolutionTask(candidate)) //todo the problem is the type of ResolutionTask is inferred as ResolutionTask too early - tasks.bar(ResolutionTask(candidate)) + tasks.bar(ResolutionTask(candidate)) tasks.add(ResolutionTask(candidate)) } } diff --git a/compiler/testData/diagnostics/tests/resolve/newLineLambda.kt b/compiler/testData/diagnostics/tests/resolve/newLineLambda.kt index 4d1e59efc31..63691dbed3f 100644 --- a/compiler/testData/diagnostics/tests/resolve/newLineLambda.kt +++ b/compiler/testData/diagnostics/tests/resolve/newLineLambda.kt @@ -99,10 +99,10 @@ fun testTwoLambdas() { {} {} - return if (true) { - twoLambdaArgs({}) + return if (true) { + twoLambdaArgs({}) {} - {} + {} } else { {} } @@ -112,6 +112,6 @@ fun testTwoLambdas() { fun f1(): (() -> Unit) -> (() -> Unit) -> Unit { return { l1 -> l1() - { l2 -> l2() } + { l2 -> l2() } } } diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/allLambdas.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/allLambdas.kt index 720d82682d6..dfd344a41c7 100644 --- a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/allLambdas.kt +++ b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/allLambdas.kt @@ -6,4 +6,4 @@ object X2 fun foo(x: T1, f: (T1) -> T1) = X1 fun foo(xf: () -> T2, f: (T2) -> T2) = X2 -val test: X2 = foo({ 0 }, { it -> it + 1 }) +val test: X2 = foo({ 0 }, { it -> it + 1 }) diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/genericClash.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/genericClash.kt index b0ccc400d48..bfcf957196d 100644 --- a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/genericClash.kt +++ b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/genericClash.kt @@ -14,6 +14,6 @@ fun baz(x: String, y: E) {} fun bar(x: A) { x.foo("") - x.baz("", "") - baz("", "") + x.baz("", "") + baz("", "") } diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt10640.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt10640.kt index 660db038f41..520acd5367f 100644 --- a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt10640.kt +++ b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt10640.kt @@ -6,4 +6,4 @@ fun T2.myUse(f: (T2) -> R2): R2 = f(this) fun test1(x: Closeable) = x.myUse { 42 } fun test2(x: Closeable) = x.myUse { 42 } -fun test3(x: Closeable) = x.myUse<AutoCloseable, Int> { 42 } // TODO KT-10681 +fun test3(x: Closeable) = x.myUse { 42 } // TODO KT-10681 diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt31670.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt31670.kt index 1fbb7b61944..bf767d349d9 100644 --- a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt31670.kt +++ b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt31670.kt @@ -11,5 +11,5 @@ fun B.foo(block: (T) -> Unit) { } fun main() { - B("string").foo { } + B("string").foo { } } diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt31758.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt31758.kt index c25bea63184..7f99d37bbde 100644 --- a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt31758.kt +++ b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt31758.kt @@ -21,5 +21,5 @@ import a.* import b.* fun test() { - foo { } + foo { } } diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/overloadResolutionOnNullableContravariantParameter.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/overloadResolutionOnNullableContravariantParameter.kt index c61a06997d6..a9b8e646898 100644 --- a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/overloadResolutionOnNullableContravariantParameter.kt +++ b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/overloadResolutionOnNullableContravariantParameter.kt @@ -19,5 +19,5 @@ import a.* import b.* fun main() { - foo { } + foo { } } diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/withVariance.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/withVariance.kt index c91b1261e50..0276c54a690 100644 --- a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/withVariance.kt +++ b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/withVariance.kt @@ -6,4 +6,4 @@ class A fun A.foo() = X1 fun A.foo() = X2 -fun A.test() = foo() // TODO fix constraint system +fun A.test() = foo() // TODO fix constraint system diff --git a/compiler/testData/diagnostics/tests/resolve/specialConstructions/constantsInIf.kt b/compiler/testData/diagnostics/tests/resolve/specialConstructions/constantsInIf.kt index d38b8386b33..34817b55440 100644 --- a/compiler/testData/diagnostics/tests/resolve/specialConstructions/constantsInIf.kt +++ b/compiler/testData/diagnostics/tests/resolve/specialConstructions/constantsInIf.kt @@ -1,13 +1,13 @@ // !DIAGNOSTICS: -USELESS_ELVIS fun test() { - bar(if (true) { - 1 + bar(if (true) { + 1 } else { - 2 + 2 }) - bar(1 ?: 2) + bar(1 ?: 2) } fun bar(s: String) = s diff --git a/compiler/testData/diagnostics/tests/resolve/specialConstructions/elvisAsCall.kt b/compiler/testData/diagnostics/tests/resolve/specialConstructions/elvisAsCall.kt index 862a731981c..cb44030c595 100644 --- a/compiler/testData/diagnostics/tests/resolve/specialConstructions/elvisAsCall.kt +++ b/compiler/testData/diagnostics/tests/resolve/specialConstructions/elvisAsCall.kt @@ -13,7 +13,7 @@ fun testElvis(a: Int?, b: Int?) { if (a != null) { doInt(b ?: a) } - doList(getList() ?: emptyListOfA()) //should be an error + doList(getList() ?: emptyListOfA()) //should be an error doList(getList() ?: strangeList { doInt(it) }) //lambda was not analyzed } @@ -32,5 +32,5 @@ fun testDataFlowInfo2(a: Int?, b: Int?) { } fun testTypeMismatch(a: String?, b: Any) { - doInt(a ?: b) + doInt(a ?: b) } diff --git a/compiler/testData/diagnostics/tests/resolve/specialConstructions/exclExclAsCall.kt b/compiler/testData/diagnostics/tests/resolve/specialConstructions/exclExclAsCall.kt index 1db39ad5555..52d11c382ca 100644 --- a/compiler/testData/diagnostics/tests/resolve/specialConstructions/exclExclAsCall.kt +++ b/compiler/testData/diagnostics/tests/resolve/specialConstructions/exclExclAsCall.kt @@ -12,8 +12,8 @@ fun emptyNullableListOfA(): List? = null //------------------------------- fun testExclExcl() { - doList(emptyNullableListOfA()!!) //should be an error here - val l: List = id(emptyNullableListOfA()!!) + doList(emptyNullableListOfA()!!) //should be an error here + val l: List = id(emptyNullableListOfA()!!) doList(strangeNullableList { doInt(it) }!!) //lambda should be analyzed (at completion phase) } diff --git a/compiler/testData/diagnostics/tests/resolve/specialConstructions/multipleSuperClasses.kt b/compiler/testData/diagnostics/tests/resolve/specialConstructions/multipleSuperClasses.kt index 11c23dfe05d..d552ecf374c 100644 --- a/compiler/testData/diagnostics/tests/resolve/specialConstructions/multipleSuperClasses.kt +++ b/compiler/testData/diagnostics/tests/resolve/specialConstructions/multipleSuperClasses.kt @@ -8,7 +8,7 @@ interface D: A, B interface E: A, B fun foo(c: C?, d: D?, e: E?) { - val test1: A? = c ?: d ?: e + val test1: A? = c ?: d ?: e val test2: B? = if (false) if (true) c else d else e diff --git a/compiler/testData/diagnostics/tests/resolve/specialConstructions/reportTypeMismatchDeeplyOnBranches.kt b/compiler/testData/diagnostics/tests/resolve/specialConstructions/reportTypeMismatchDeeplyOnBranches.kt index 2c4d876bcec..d72be17b35e 100644 --- a/compiler/testData/diagnostics/tests/resolve/specialConstructions/reportTypeMismatchDeeplyOnBranches.kt +++ b/compiler/testData/diagnostics/tests/resolve/specialConstructions/reportTypeMismatchDeeplyOnBranches.kt @@ -3,25 +3,25 @@ package b fun bar(i: Int) = i fun test(a: Int?, b: Int?) { - bar(if (a == null) return else b) + bar(if (a == null) return else b) } fun test(a: Int?, b: Int?, c: Int?) { - bar(if (a == null) return else if (b == null) return else c) + bar(if (a == null) return else if (b == null) return else c) } fun test(a: Any?, b: Any?, c: Int?) { - bar(if (a == null) if (b == null) c else return else return) + bar(if (a == null) if (b == null) c else return else return) } fun test(a: Int?, b: Any?, c: Int?) { - bar(if (a == null) { + bar(if (a == null) { return } else { if (b == null) { return } else { - c + c } }) } diff --git a/compiler/testData/diagnostics/tests/resolve/wrongNumberOfTypeArguments.kt b/compiler/testData/diagnostics/tests/resolve/wrongNumberOfTypeArguments.kt index 613a6e6d025..d2f66177bbe 100644 --- a/compiler/testData/diagnostics/tests/resolve/wrongNumberOfTypeArguments.kt +++ b/compiler/testData/diagnostics/tests/resolve/wrongNumberOfTypeArguments.kt @@ -3,12 +3,12 @@ fun foo(t: T) = t fun test1() { - foo("") + foo("") } fun bar(t: T, r: R) {} fun test2() { - bar("", "") + bar("", "") } diff --git a/compiler/testData/diagnostics/tests/scopes/protectedVisibility/syntheticSAMExtensions.kt b/compiler/testData/diagnostics/tests/scopes/protectedVisibility/syntheticSAMExtensions.kt index 4775674e343..f2359b6a7b4 100644 --- a/compiler/testData/diagnostics/tests/scopes/protectedVisibility/syntheticSAMExtensions.kt +++ b/compiler/testData/diagnostics/tests/scopes/protectedVisibility/syntheticSAMExtensions.kt @@ -20,7 +20,7 @@ class B : A() { } if (d.x is B) { - d.x.foo {} + d.x.foo {} } } } diff --git a/compiler/testData/diagnostics/tests/scopes/protectedVisibility/unstableSmartCast.kt b/compiler/testData/diagnostics/tests/scopes/protectedVisibility/unstableSmartCast.kt index 980f769fc71..1da2463f075 100644 --- a/compiler/testData/diagnostics/tests/scopes/protectedVisibility/unstableSmartCast.kt +++ b/compiler/testData/diagnostics/tests/scopes/protectedVisibility/unstableSmartCast.kt @@ -12,7 +12,7 @@ class Derived : BaseOuter() { fun test(foo: Foo) { if (foo.base is Derived) { foo.base.foo() checkType { _() } // Resolved to extension - foo.base.bar() + foo.base.bar() } } } diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/constructorCallType.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/constructorCallType.kt index 9b43b8ab38b..59bbe40ef17 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/constructorCallType.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/constructorCallType.kt @@ -20,8 +20,8 @@ val y4: B = B("") val y5: B = B(1) val y6: B = B("") -val y7: B = B(1) +val y7: B = B(1) val y8: B = B("") val y9 = B(1) -val y10 = B("") +val y10 = B("") diff --git a/compiler/testData/diagnostics/tests/smartCasts/alwaysNull.kt b/compiler/testData/diagnostics/tests/smartCasts/alwaysNull.kt index d382f90bc92..91ce8cbb463 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/alwaysNull.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/alwaysNull.kt @@ -2,12 +2,12 @@ fun foo(): String { var s: String? s = null s?.length - s.length + s.length if (s == null) return s!! var t: String? = "y" if (t == null) t = "x" var x: Int? = null - if (x == null) x += null + if (x == null) x += null return t + s } @@ -15,7 +15,7 @@ fun String?.gav() {} fun bar(s: String?) { if (s != null) return - s.gav() + s.gav() s as? String s as String? s as String diff --git a/compiler/testData/diagnostics/tests/smartCasts/alwaysNullWithJava.kt b/compiler/testData/diagnostics/tests/smartCasts/alwaysNullWithJava.kt index 27f1855b0ed..e4012d70daa 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/alwaysNullWithJava.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/alwaysNullWithJava.kt @@ -10,7 +10,6 @@ public class My { fun test() { val my = My.create() if (my == null) { - my.foo() + my.foo() } } - diff --git a/compiler/testData/diagnostics/tests/smartCasts/castchecks/variables.kt b/compiler/testData/diagnostics/tests/smartCasts/castchecks/variables.kt index 02a71f401b9..e5ffe5cf0cb 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/castchecks/variables.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/castchecks/variables.kt @@ -40,7 +40,7 @@ fun f(a: SomeClass?) { if (aa as? SomeSubClass != null) { aa = null // 'aa' cannot be cast to SomeSubClass - aa.hashCode() + aa.hashCode() aa.foo (aa as? SomeSubClass).foo (aa as SomeSubClass).foo @@ -49,7 +49,7 @@ fun f(a: SomeClass?) { aa = null if (b != null) { // 'aa' cannot be cast to SomeSubClass - aa.hashCode() + aa.hashCode() aa.foo (aa as? SomeSubClass).foo (aa as SomeSubClass).foo diff --git a/compiler/testData/diagnostics/tests/smartCasts/comparisonUnderAnd.kt b/compiler/testData/diagnostics/tests/smartCasts/comparisonUnderAnd.kt index 3c76fa5cefd..a2601acaecc 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/comparisonUnderAnd.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/comparisonUnderAnd.kt @@ -15,12 +15,12 @@ fun foo(x : String?, y : String?) { else { // y == null but x != y x.length - y.length + y.length } if (y == null && x != y) { // y == null but x != y x.length - y.length + y.length } else { x.length diff --git a/compiler/testData/diagnostics/tests/smartCasts/complexComparison.kt b/compiler/testData/diagnostics/tests/smartCasts/complexComparison.kt index 88ca7ecf7e3..10bc876dba2 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/complexComparison.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/complexComparison.kt @@ -6,7 +6,7 @@ fun foo(x: String?, y: String?, z: String?, w: String?) { if (x != null || y != null || (x != z && y != z)) z.length else - z.length + z.length if (x == null || y == null || (x != z && y != z)) z.length else diff --git a/compiler/testData/diagnostics/tests/smartCasts/elvis/impossible.kt b/compiler/testData/diagnostics/tests/smartCasts/elvis/impossible.kt index dec370ba256..dd4184904de 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/elvis/impossible.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/elvis/impossible.kt @@ -17,7 +17,7 @@ fun foo(list: StringList, arg: Unstable) { list.remove(arg.first) if (arg.first?.isEmpty() ?: false) { // Should be still resolved to extension, without smart cast or smart cast impossible - list.remove(arg.first) + list.remove(arg.first) } } @@ -35,6 +35,6 @@ fun bar(list: BooleanList, arg: UnstableBoolean) { list.remove(arg.first) if (arg.first ?: false) { // Should be still resolved to extension, without smart cast or smart cast impossible - list.remove(arg.first) + list.remove(arg.first) } } diff --git a/compiler/testData/diagnostics/tests/smartCasts/inference/intersectionTypes.kt b/compiler/testData/diagnostics/tests/smartCasts/inference/intersectionTypes.kt index ebe4201b4c2..2298c240db7 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/inference/intersectionTypes.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/inference/intersectionTypes.kt @@ -16,7 +16,7 @@ interface C: A fun test(a: A, b: B, c: C) { if (a is B && a is C) { - val d: C = id(a) + val d: C = id(a) val e: Any = id(a) val f = id(a) checkSubtype(f) @@ -30,7 +30,7 @@ fun test(a: A, b: B, c: C) { val k = three(a, b, c) checkSubtype(k) checkSubtype(k) - val l: Int = three(a, b, c) + val l: Int = three(a, b, c) use(d, e, f, g, h, k, l) } @@ -40,11 +40,11 @@ fun foo(t: T, l: MutableList): T = t fun testErrorMessages(a: A, ml: MutableList) { if (a is B && a is C) { - foo(a, ml) + foo(a, ml) } if(a is C) { - foo(a, ml) + foo(a, ml) } } diff --git a/compiler/testData/diagnostics/tests/smartCasts/inference/kt29767.kt b/compiler/testData/diagnostics/tests/smartCasts/inference/kt29767.kt index a74e92e5c06..dad38a1b86a 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/inference/kt29767.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/inference/kt29767.kt @@ -2,7 +2,7 @@ fun test(a: MutableList?) { if (a != null) { - val b = a[0] // no SMARTCAST diagnostic + val b = a[0] // no SMARTCAST diagnostic if (b != null) { b.inc() } diff --git a/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/flexibleTypes.kt b/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/flexibleTypes.kt index c01162d7617..7732a8d819e 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/flexibleTypes.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/flexibleTypes.kt @@ -16,37 +16,37 @@ interface C { fun foo(x: Any?) { if (x is A && x is B) { - x.foo().checkType { _() } + x.foo().checkType { _() } x.foo().checkType { _() } } if (x is B && x is A) { - x.foo().checkType { _() } + x.foo().checkType { _() } x.foo().checkType { _() } } if (x is A && x is C) { x.foo().checkType { _() } - x.foo().checkType { _() } + x.foo().checkType { _() } } if (x is C && x is A) { x.foo().checkType { _() } - x.foo().checkType { _() } + x.foo().checkType { _() } } if (x is A && x is B && x is C) { x.foo().checkType { _() } - x.foo().checkType { _() } + x.foo().checkType { _() } } if (x is B && x is A && x is C) { x.foo().checkType { _() } - x.foo().checkType { _() } + x.foo().checkType { _() } } if (x is B && x is C && x is A) { x.foo().checkType { _() } - x.foo().checkType { _() } + x.foo().checkType { _() } } } diff --git a/compiler/testData/diagnostics/tests/smartCasts/kt10444.kt b/compiler/testData/diagnostics/tests/smartCasts/kt10444.kt index 3ab7acc1663..0cd9f6b2b56 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/kt10444.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/kt10444.kt @@ -9,7 +9,7 @@ class Qwe(val a: T?) { fun test1(obj: Qwe<*>) { obj as Qwe - check(obj.a) + check(obj.a) } fun check(a: T?) { diff --git a/compiler/testData/diagnostics/tests/smartCasts/kt2865.kt b/compiler/testData/diagnostics/tests/smartCasts/kt2865.kt index e5ce6450bff..d5f9e204a18 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/kt2865.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/kt2865.kt @@ -6,6 +6,6 @@ fun foo(a: MutableMap, x: String?) { } fun foo1(a: MutableMap, x: String?) { - a[x] = x!! + a[x] = x!! a[x!!] = x } diff --git a/compiler/testData/diagnostics/tests/smartCasts/kt30927.kt b/compiler/testData/diagnostics/tests/smartCasts/kt30927.kt index 4caf76f6d28..b27b61d3a2a 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/kt30927.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/kt30927.kt @@ -5,22 +5,22 @@ fun case_0() { val z: Any? = 10 val y = z.run { this as Int - this // error in NI: required Int, found Any?; just inferred to Any? in OI + this // error in NI: required Int, found Any?; just inferred to Any? in OI } - y checkType { _() } - y checkType { _() } + y checkType { _() } + y checkType { _() } } fun case_1(z: Any?) { val y = z.run { when (this) { - is String -> return@run this // type mismatch in the new inference (required String, found Any?) + is String -> return@run this // type mismatch in the new inference (required String, found Any?) is Float -> "" else -> return@run "" } } - y checkType { _() } - y checkType { _() } + y checkType { _() } + y checkType { _() } // y is inferred to Any? } @@ -39,12 +39,12 @@ fun case_2(z: Any?) { fun case_3(z: Any?) { val y = z.let { when (it) { - is String -> return@let it + is String -> return@let it is Float -> "" else -> return@let "" } } - y checkType { _() } - y checkType { _() } + y checkType { _() } + y checkType { _() } // y is inferred to String } diff --git a/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentWithBoundWithoutType.kt b/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentWithBoundWithoutType.kt index 0e6ac8e12f0..c73e2efec83 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentWithBoundWithoutType.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentWithBoundWithoutType.kt @@ -12,14 +12,14 @@ val foo: Foo = run { x } -val foofoo: Foo = run { +val foofoo: Foo = run { val x = foo() if (x == null) throw Exception() - x + x } -val bar: Bar = run { +val bar: Bar = run { val x = foo() if (x == null) throw Exception() - x + x } diff --git a/compiler/testData/diagnostics/tests/smartCasts/variables/ifNullAssignment.kt b/compiler/testData/diagnostics/tests/smartCasts/variables/ifNullAssignment.kt index 7ca923d2eb0..02e58157287 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/variables/ifNullAssignment.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/variables/ifNullAssignment.kt @@ -68,5 +68,5 @@ fun gau(flag: Boolean, arg: String?) { } } - x.hashCode() + x.hashCode() } diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/assignment.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/assignment.kt index fc8eaf4e00d..ad82cdb18e5 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/assignment.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/assignment.kt @@ -4,7 +4,7 @@ fun foo() { v = "abc" v.length v = null - v.length + v.length v = "abc" v.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/boundInitializerWrong.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/boundInitializerWrong.kt index c6478189d1b..3af91c1234b 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/boundInitializerWrong.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/boundInitializerWrong.kt @@ -5,7 +5,7 @@ fun foo() { val y = x x = null if (y != null) { - x.hashCode() + x.hashCode() } } @@ -22,7 +22,7 @@ fun bar(s: String?) { val hashCode = ss?.hashCode() ss = null if (hashCode != null) { - ss.hashCode() + ss.hashCode() } } diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/initInTryReturnInCatch.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/initInTryReturnInCatch.kt index 00d2269a78e..c68150b7609 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/initInTryReturnInCatch.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/initInTryReturnInCatch.kt @@ -75,5 +75,5 @@ fun test6() { finally { a = null } - a.hashCode() // a is null here + a.hashCode() // a is null here } diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/initialization.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/initialization.kt index 567d8290789..b1bbc823964 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/initialization.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/initialization.kt @@ -3,5 +3,5 @@ fun foo() { // It is possible in principle to provide smart cast here v.length v = null - v.length + v.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/plusplusMinusminus.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/plusplusMinusminus.kt index 1cc64980ac5..a10f6ae693c 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/plusplusMinusminus.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/plusplusMinusminus.kt @@ -11,7 +11,7 @@ operator fun Long?.inc() = this?.let { it + 1 } fun bar(arg: Long?): Long { var i = arg if (i++ == 5L) { - return i-- + i + return i-- + i } if (i++ == 7L) { return i++ + i diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNotnullClassIncrement.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNotnullClassIncrement.kt index 9596d64a6d8..fa5ee173d15 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNotnullClassIncrement.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNotnullClassIncrement.kt @@ -1,6 +1,6 @@ class MyClass -operator fun MyClass.inc(): MyClass { return null!! } +operator fun MyClass.inc(): MyClass { return null!! } public fun box() : MyClass? { var i : MyClass? diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNotnullClassIncrement.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNotnullClassIncrement.kt index 85c2e48241a..e2df6a91601 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNotnullClassIncrement.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNotnullClassIncrement.kt @@ -1,6 +1,6 @@ class MyClass -operator fun MyClass.inc(): MyClass { return null!! } +operator fun MyClass.inc(): MyClass { return null!! } public fun box() { var i : MyClass? diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessaryWithMap.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessaryWithMap.kt index 913020fcebd..4004c932e00 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessaryWithMap.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessaryWithMap.kt @@ -1,4 +1,3 @@ - fun create(): Map = null!! operator fun Map.iterator(): Iterator> = null!! @@ -14,7 +13,7 @@ class MyClass { m = create() // See KT-7428 for ((k, v) in m) - res += (k.length + v.length) + res += (k.length + v.length) return res } } diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/varIntNull.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/varIntNull.kt index cc8df087fd7..6fd528d5d8f 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/varIntNull.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/varIntNull.kt @@ -1,5 +1,5 @@ fun foo(): Int { var i: Int? = 42 i = null - return i + 1 + return i + 1 } diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/varNull.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/varNull.kt index 2977569c52f..4cc06ddf621 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/varNull.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/varNull.kt @@ -1,5 +1,5 @@ fun foo(): Int { var s: String? = "abc" s = null - return s.length + return s.length } diff --git a/compiler/testData/diagnostics/tests/substitutions/starProjections.kt b/compiler/testData/diagnostics/tests/substitutions/starProjections.kt index be80ee9407f..82c094953bc 100644 --- a/compiler/testData/diagnostics/tests/substitutions/starProjections.kt +++ b/compiler/testData/diagnostics/tests/substitutions/starProjections.kt @@ -16,9 +16,8 @@ interface B, T>> { } fun testB(b: B<*, *>) { - b.r().checkType { _() } - b.t().checkType { _, *>>() } + b.r().checkType { _() } + b.t().checkType { _, *>>() } - b.t().r().size + b.t().r().size } - diff --git a/compiler/testData/diagnostics/tests/substitutions/upperBoundsSubstitutionForOverloadResolutionWithAmbiguity.kt b/compiler/testData/diagnostics/tests/substitutions/upperBoundsSubstitutionForOverloadResolutionWithAmbiguity.kt index 1a775a5d913..b381cd916ee 100644 --- a/compiler/testData/diagnostics/tests/substitutions/upperBoundsSubstitutionForOverloadResolutionWithAmbiguity.kt +++ b/compiler/testData/diagnostics/tests/substitutions/upperBoundsSubstitutionForOverloadResolutionWithAmbiguity.kt @@ -14,5 +14,5 @@ import foo.* import bar.* fun test(l: List) { - f(l) + f(l) } diff --git a/compiler/testData/diagnostics/tests/substitutions/upperBoundsSubstitutionForOverloadResolutionWithErrorTypes.kt b/compiler/testData/diagnostics/tests/substitutions/upperBoundsSubstitutionForOverloadResolutionWithErrorTypes.kt index 6f3a22c6407..86392f91495 100644 --- a/compiler/testData/diagnostics/tests/substitutions/upperBoundsSubstitutionForOverloadResolutionWithErrorTypes.kt +++ b/compiler/testData/diagnostics/tests/substitutions/upperBoundsSubstitutionForOverloadResolutionWithErrorTypes.kt @@ -4,5 +4,5 @@ fun f1(l: List2): T {throw Exception()} // ERR fun f1(c: Collection): T{throw Exception()} fun test(l: List) { - f1(l) + f1(l) } diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/InnerClassInGeneric.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/InnerClassInGeneric.kt index 8060cdab343..d396369d74a 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/InnerClassInGeneric.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/InnerClassInGeneric.kt @@ -1,7 +1,7 @@ // FILE: KotlinFile.kt fun foo(javaClass: JavaClass): Int { val inner = javaClass.createInner() - return inner.doSomething(1, "") { } + return inner.doSomething(1, "") { } } // FILE: JavaClass.java diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/Private.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/Private.kt index 1d1f9804e89..fb8e881f62b 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/Private.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/Private.kt @@ -1,6 +1,6 @@ // FILE: KotlinFile.kt fun foo(javaClass: JavaClass) { - javaClass.doSomething { } + javaClass.doSomething { } } // FILE: JavaClass.java diff --git a/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/ambiguousSuperWithGenerics.kt b/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/ambiguousSuperWithGenerics.kt index 1f3c2ecde08..eab44b72628 100644 --- a/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/ambiguousSuperWithGenerics.kt +++ b/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/ambiguousSuperWithGenerics.kt @@ -13,7 +13,7 @@ class GenericDerivedClass : GenericBaseClass(), GenericBaseInterface { override fun bar(x: T): T = super.bar(x) override fun ambiguous(x: T): T = - super.ambiguous(x) + super.ambiguous(x) } class SpecializedDerivedClass : GenericBaseClass(), GenericBaseInterface { @@ -21,9 +21,9 @@ class SpecializedDerivedClass : GenericBaseCl override fun bar(x: String): String = super.bar(x) override fun ambiguous(x: String): String = - super.ambiguous(x) + super.ambiguous(x) override fun ambiguous(x: Int): Int = - super.ambiguous(x) + super.ambiguous(x) } class MixedDerivedClass : GenericBaseClass(), GenericBaseInterface { @@ -31,7 +31,7 @@ class MixedDerivedClass : GenericBaseClass override fun bar(x: T): T = super.bar(x) override fun ambiguous(x: Int): Int = - super.ambiguous(x) + super.ambiguous(x) override fun ambiguous(x: T): T = - super.ambiguous(x) + super.ambiguous(x) } diff --git a/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/unqualifiedSuperWithCallableProperty.kt b/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/unqualifiedSuperWithCallableProperty.kt index 46f00d11e68..42093886dff 100644 --- a/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/unqualifiedSuperWithCallableProperty.kt +++ b/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/unqualifiedSuperWithCallableProperty.kt @@ -13,7 +13,7 @@ interface InterfaceWithFun { class DerivedUsingFun : BaseWithCallableProp(), InterfaceWithFun { fun foo(): String = - super.fn() + super.fn() override fun bar(): String = super.bar() diff --git a/compiler/testData/diagnostics/tests/typeParameters/implicitNothingInReturnPosition.kt b/compiler/testData/diagnostics/tests/typeParameters/implicitNothingInReturnPosition.kt index a0a8bf37a92..63552fea2e5 100644 --- a/compiler/testData/diagnostics/tests/typeParameters/implicitNothingInReturnPosition.kt +++ b/compiler/testData/diagnostics/tests/typeParameters/implicitNothingInReturnPosition.kt @@ -39,7 +39,7 @@ class Context fun Any.decodeIn(typeFrom: Context): T = something() fun Any?.decodeOut1(typeFrom: Context): T { - return this?.decodeIn(typeFrom) ?: kotlin.Unit + return this?.decodeIn(typeFrom) ?: kotlin.Unit } fun Any.decodeOut2(typeFrom: Context): T { diff --git a/compiler/testData/diagnostics/tests/typealias/boundsViolationInTypeAliasExpansion.kt b/compiler/testData/diagnostics/tests/typealias/boundsViolationInTypeAliasExpansion.kt index 0abf9708a82..badd11e9c6c 100644 --- a/compiler/testData/diagnostics/tests/typealias/boundsViolationInTypeAliasExpansion.kt +++ b/compiler/testData/diagnostics/tests/typealias/boundsViolationInTypeAliasExpansion.kt @@ -17,8 +17,8 @@ fun test4(x: NL) {} val test5 = NA() val test6 = NA<Any>() val test7 = NL() -val test8 = MMMM<Int>() -val test9dwd = NL() +val test8 = MMMM<Int>() +val test9dwd = NL() fun test9(x: TC>) {} fun test10(x: TC>) {} diff --git a/compiler/testData/diagnostics/tests/typealias/innerClassTypeAliasConstructor.kt b/compiler/testData/diagnostics/tests/typealias/innerClassTypeAliasConstructor.kt index 70599f8c1fa..4a7b173a0cf 100644 --- a/compiler/testData/diagnostics/tests/typealias/innerClassTypeAliasConstructor.kt +++ b/compiler/testData/diagnostics/tests/typealias/innerClassTypeAliasConstructor.kt @@ -19,5 +19,5 @@ typealias GIntI = Generic.Inner fun test2(x: Generic) = x.GI() fun test3(x: Generic) = x.GI() fun test4(x: Generic>) = x.GI() -fun test5(x: Generic) = x.GIntI() +fun test5(x: Generic) = x.GIntI() fun Generic.test6() = GIntI() diff --git a/compiler/testData/diagnostics/tests/typealias/innerClassTypeAliasConstructorInSupertypes.kt b/compiler/testData/diagnostics/tests/typealias/innerClassTypeAliasConstructorInSupertypes.kt index d4afb618214..613a02b45a5 100644 --- a/compiler/testData/diagnostics/tests/typealias/innerClassTypeAliasConstructorInSupertypes.kt +++ b/compiler/testData/diagnostics/tests/typealias/innerClassTypeAliasConstructorInSupertypes.kt @@ -21,16 +21,16 @@ class Generic { open inner class Generic inner class Test1 : GI() - inner class Test2 : GIInt() + inner class Test2 : GIInt() inner class Test3 : GIStar() inner class Test3a : test.Generic<*>.Inner() inner class Test4 : GG() inner class Test5 : GG() - inner class Test6 : GG() - inner class Test7 : GG() - inner class Test8 : GIntG() - inner class Test9 : GGInt() + inner class Test6 : GG() + inner class Test7 : GG() + inner class Test8 : GIntG() + inner class Test9 : GGInt() inner class Test10 : GGInt() inner class Test11 : GG { diff --git a/compiler/testData/diagnostics/tests/typealias/innerTypeAliasConstructor.kt b/compiler/testData/diagnostics/tests/typealias/innerTypeAliasConstructor.kt index 9280bcf6801..5cc719abff4 100644 --- a/compiler/testData/diagnostics/tests/typealias/innerTypeAliasConstructor.kt +++ b/compiler/testData/diagnostics/tests/typealias/innerTypeAliasConstructor.kt @@ -19,5 +19,5 @@ val test4 = C.P2(1, // C.P() syntax could work if we add captured type parameters as type variables in a constraint system for corresponding call. // However, this should be consistent with inner classes capturing type parameters. val test5 = C.P(1, 1) -val test6 = C.P1("", 1) -val test7 = C.P2(1, "") +val test6 = C.P1("", 1) +val test7 = C.P2(1, "") diff --git a/compiler/testData/diagnostics/tests/typealias/noApproximationInTypeAliasArgumentSubstitution.kt b/compiler/testData/diagnostics/tests/typealias/noApproximationInTypeAliasArgumentSubstitution.kt index 32f344d14c4..6ad583d1dbe 100644 --- a/compiler/testData/diagnostics/tests/typealias/noApproximationInTypeAliasArgumentSubstitution.kt +++ b/compiler/testData/diagnostics/tests/typealias/noApproximationInTypeAliasArgumentSubstitution.kt @@ -13,4 +13,4 @@ typealias TMap = Map fun foo2(m: TMap) = m fun bar2(m: TMap<*>) = - foo2(m) + foo2(m) diff --git a/compiler/testData/diagnostics/tests/typealias/starProjection.kt b/compiler/testData/diagnostics/tests/typealias/starProjection.kt index 7f7c9699cd5..a91edf0a288 100644 --- a/compiler/testData/diagnostics/tests/typealias/starProjection.kt +++ b/compiler/testData/diagnostics/tests/typealias/starProjection.kt @@ -9,6 +9,6 @@ fun test2(x: Map) = check(x) fun test3(x: Map) = check(x).size -fun test4(x: Map) = check(x)["42"] +fun test4(x: Map) = check(x)["42"] -fun test5(x: Map) = check(x)[42] +fun test5(x: Map) = check(x)[42] diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorCrazyProjections.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorCrazyProjections.kt index d2065df10ff..70f2117730e 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorCrazyProjections.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorCrazyProjections.kt @@ -10,6 +10,6 @@ fun listOf(): List = null!! // Unresolved reference is ok here: // we can't create a substituted signature for type alias constructor // since it has 'out' type projection in 'in' position. -val test1 = BOutIn(listOf(), null!!) +val test1 = BOutIn(listOf(), null!!) -val test2 = BInIn(listOf(), null!!) +val test2 = BInIn(listOf(), null!!) diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorForProjection.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorForProjection.kt index a933b076bb8..f856dede5a4 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorForProjection.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorForProjection.kt @@ -7,8 +7,8 @@ typealias CIn = C typealias COut = C typealias CT = C -val test1 = CStar() -val test2 = CIn() -val test3 = COut() -val test4 = CT<*>() +val test1 = CStar() +val test2 = CIn() +val test3 = COut() +val test4 = CT<*>() val test5 = CT>() diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorForProjectionInSupertypes.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorForProjectionInSupertypes.kt index e56fc7f9b41..9a6c654bfff 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorForProjectionInSupertypes.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorForProjectionInSupertypes.kt @@ -5,12 +5,12 @@ typealias CIn = C typealias COut = C typealias CT = C -class Test1 : CStar() -class Test2 : CIn() -class Test3 : COut() +class Test1 : CStar() +class Test2 : CIn() +class Test3 : COut() class Test4 : CStar { - constructor() : super() + constructor() : super() } class Test5 : CT<*>() diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInference.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInference.kt index e7d0847dba5..96f71bb6eac 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInference.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInference.kt @@ -4,15 +4,15 @@ class Num(val x: Tn) typealias N = Num val test0 = N(1) -val test1 = N("1") +val test1 = N("1") class Cons(val head: T, val tail: Cons?) typealias C = Cons typealias CC = C> -val test2 = C(1, 2) -val test3 = CC(1, 2) +val test2 = C(1, 2) +val test3 = CC(1, 2) val test4 = CC(C(1, null), null) @@ -20,13 +20,13 @@ class Pair(val x: X, val y: Y) typealias PL = Pair> typealias PN = Pair> -val test5 = PL(1, null) +val test5 = PL(1, null) class Foo(val p: Pair) typealias F = Foo -fun testProjections1(x: Pair) = F(x) -fun testProjections2(x: Pair) = F(x) -fun testProjections3(x: Pair) = F(x) -fun testProjections4(x: Pair) = F(x) +fun testProjections1(x: Pair) = F(x) +fun testProjections2(x: Pair) = F(x) +fun testProjections3(x: Pair) = F(x) +fun testProjections4(x: Pair) = F(x) diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithNestedCalls2.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithNestedCalls2.kt index dab82144ff6..3f0becf950c 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithNestedCalls2.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithNestedCalls2.kt @@ -31,8 +31,8 @@ val r3 = LateInitNumRef(1) val r3a = LateNR(1) fun test() { - r1.x = r1.x - r1a.x = r1a.x + r1.x = r1.x + r1a.x = r1a.x r2.x = r2.x r2a.x = r2a.x r3.x = r3.x diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithPhantomTypes.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithPhantomTypes.kt index b4c59136b8e..fff41b71315 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithPhantomTypes.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithPhantomTypes.kt @@ -8,9 +8,9 @@ class Hr(val a: A, val b: B) typealias Test = Hr, Bar> val test1 = Test(1, "") -val test2 = Test(1, 2) +val test2 = Test(1, 2) typealias Bas = Hr, Bar> -val test3 = Bas(1, 1) +val test3 = Bas(1, 1) diff --git a/compiler/testData/diagnostics/tests/typealias/wrongNumberOfArgumentsInTypeAliasConstructor.kt b/compiler/testData/diagnostics/tests/typealias/wrongNumberOfArgumentsInTypeAliasConstructor.kt index 3c8e33aad33..bc5a996214f 100644 --- a/compiler/testData/diagnostics/tests/typealias/wrongNumberOfArgumentsInTypeAliasConstructor.kt +++ b/compiler/testData/diagnostics/tests/typealias/wrongNumberOfArgumentsInTypeAliasConstructor.kt @@ -20,15 +20,15 @@ val test2p2 = P2(1, 1) val test3p2 = P2(1, 1) val test0pr = PR(1, "") -val test1pr = PR(1, "") +val test1pr = PR(1, "") val test2pr = PR(1, "") val test2pra = PR(1, "") -val test3pr = P2(1, "") +val test3pr = P2(1, "") class Num(val x: T) typealias N = Num -val testN0 = N("") +val testN0 = N("") val testN1 = N(1) val testN1a = N<String>("") val testN2 = N(1) @@ -37,5 +37,5 @@ class MyPair(val string: T1, val number: T2) typealias MP = MyPair val testMP0 = MP("", 1) -val testMP1 = MP(1, "") +val testMP1 = MP(1, "") val testMP2 = MP<String>("", "") diff --git a/compiler/testData/diagnostics/tests/unsignedTypes/conversions/conversionOfSignedToUnsigned.kt b/compiler/testData/diagnostics/tests/unsignedTypes/conversions/conversionOfSignedToUnsigned.kt index 50bf2b5a160..91b4d970823 100644 --- a/compiler/testData/diagnostics/tests/unsignedTypes/conversions/conversionOfSignedToUnsigned.kt +++ b/compiler/testData/diagnostics/tests/unsignedTypes/conversions/conversionOfSignedToUnsigned.kt @@ -54,7 +54,7 @@ fun test() { takeUBytes(IMPLICIT_INT, EXPLICIT_INT, 42u) - takeLong(IMPLICIT_INT) + takeLong(IMPLICIT_INT) takeIntWithoutAnnotation(IMPLICIT_INT) diff --git a/compiler/testData/diagnostics/tests/unsignedTypes/conversions/inferenceForSignedAndUnsignedTypes.kt b/compiler/testData/diagnostics/tests/unsignedTypes/conversions/inferenceForSignedAndUnsignedTypes.kt index 6f552fbd67d..0e2cd85c66f 100644 --- a/compiler/testData/diagnostics/tests/unsignedTypes/conversions/inferenceForSignedAndUnsignedTypes.kt +++ b/compiler/testData/diagnostics/tests/unsignedTypes/conversions/inferenceForSignedAndUnsignedTypes.kt @@ -9,8 +9,8 @@ fun select(x: K, y: K): K = TODO() fun takeUByte(u: UByte) {} fun foo() { - select(1, 1u) checkType { _>() } - takeUByte(id(1)) + select(1, 1u) checkType { _>() } + takeUByte(id(1)) 1 + 1u (1u + 1) checkType { _() } diff --git a/compiler/testData/diagnostics/tests/unsignedTypes/conversions/signedToUnsignedConversionWithExpectedType.kt b/compiler/testData/diagnostics/tests/unsignedTypes/conversions/signedToUnsignedConversionWithExpectedType.kt index 67c0488a20c..b3514dc6dfa 100644 --- a/compiler/testData/diagnostics/tests/unsignedTypes/conversions/signedToUnsignedConversionWithExpectedType.kt +++ b/compiler/testData/diagnostics/tests/unsignedTypes/conversions/signedToUnsignedConversionWithExpectedType.kt @@ -26,7 +26,7 @@ fun test() { takeUInt(1) takeULong(1) - takeULong(18446744073709551615) + takeULong(18446744073709551615) takeULong(1844674407370955161) takeULong(18446744073709551615u) diff --git a/compiler/testData/diagnostics/tests/varargs/NullableTypeForVarargArgument.kt b/compiler/testData/diagnostics/tests/varargs/NullableTypeForVarargArgument.kt index 56f99761caf..dbdde446817 100644 --- a/compiler/testData/diagnostics/tests/varargs/NullableTypeForVarargArgument.kt +++ b/compiler/testData/diagnostics/tests/varargs/NullableTypeForVarargArgument.kt @@ -31,13 +31,13 @@ fun getArr(): Array? = null fun f() { A().foo(1, *args) bar(2, *args) - baz(*args) + baz(*args) } fun g(args: Array?) { if (args != null) { - A().foo(1, *args) + A().foo(1, *args) } A().foo(1, *A.ar) } @@ -48,14 +48,14 @@ class B { fun h(b: B) { if (b.args != null) { - A().foo(1, *b.args) + A().foo(1, *b.args) } } fun k() { A().foo(1, *getArr()) bar(2, *getArr()) - baz(*getArr()) + baz(*getArr()) } fun invokeTest(goodArgs: Array) { diff --git a/compiler/testData/diagnostics/tests/varargs/assignArrayToVararagInNamedForm_1_3.kt b/compiler/testData/diagnostics/tests/varargs/assignArrayToVararagInNamedForm_1_3.kt index 800c844b1a0..8536a331c19 100644 --- a/compiler/testData/diagnostics/tests/varargs/assignArrayToVararagInNamedForm_1_3.kt +++ b/compiler/testData/diagnostics/tests/varargs/assignArrayToVararagInNamedForm_1_3.kt @@ -19,7 +19,7 @@ fun test_fun(s: String, arr: Array) { } fun test_ann(s: String, arr: Array) { - @Ann([""], x = 1) + @Ann([""], x = 1) foo() @Ann(*[""], x = 1) foo() diff --git a/compiler/testData/diagnostics/tests/varargs/assignArrayToVararagInNamedForm_1_4.kt b/compiler/testData/diagnostics/tests/varargs/assignArrayToVararagInNamedForm_1_4.kt index b153550462a..36d3037212a 100644 --- a/compiler/testData/diagnostics/tests/varargs/assignArrayToVararagInNamedForm_1_4.kt +++ b/compiler/testData/diagnostics/tests/varargs/assignArrayToVararagInNamedForm_1_4.kt @@ -19,7 +19,7 @@ fun test_fun(s: String, arr: Array) { } fun test_ann(s: String, arr: Array) { - @Ann([""], x = 1) + @Ann([""], x = 1) foo() @Ann(*[""], x = 1) foo() diff --git a/compiler/testData/diagnostics/tests/varargs/assigningArraysToVarargsInAnnotations.kt b/compiler/testData/diagnostics/tests/varargs/assigningArraysToVarargsInAnnotations.kt index 9dfd03c0423..490612be1c2 100644 --- a/compiler/testData/diagnostics/tests/varargs/assigningArraysToVarargsInAnnotations.kt +++ b/compiler/testData/diagnostics/tests/varargs/assigningArraysToVarargsInAnnotations.kt @@ -17,7 +17,7 @@ fun test1() {} @Ann(s = intArrayOf()) fun test2() {} -@Ann(s = arrayOf(1)) +@Ann(s = arrayOf(1)) fun test3() {} @Ann("value1", "value2") diff --git a/compiler/testData/diagnostics/tests/varargs/assigningSingleElementsInNamedFormFunDeprecation_after.kt b/compiler/testData/diagnostics/tests/varargs/assigningSingleElementsInNamedFormFunDeprecation_after.kt index 9417213e3de..ed8c8a13476 100644 --- a/compiler/testData/diagnostics/tests/varargs/assigningSingleElementsInNamedFormFunDeprecation_after.kt +++ b/compiler/testData/diagnostics/tests/varargs/assigningSingleElementsInNamedFormFunDeprecation_after.kt @@ -52,8 +52,8 @@ fun testMany(a: Any) { manyFoo(s = "") manyFoo(a) - manyFoo(v = a) - manyFoo(s = a) + manyFoo(v = a) + manyFoo(s = a) manyFoo(v = a as Int) manyFoo(s = a as String) } diff --git a/compiler/testData/diagnostics/tests/varargs/assigningSingleElementsInNamedFormFunDeprecation_before.kt b/compiler/testData/diagnostics/tests/varargs/assigningSingleElementsInNamedFormFunDeprecation_before.kt index c27c3492786..934707a86ca 100644 --- a/compiler/testData/diagnostics/tests/varargs/assigningSingleElementsInNamedFormFunDeprecation_before.kt +++ b/compiler/testData/diagnostics/tests/varargs/assigningSingleElementsInNamedFormFunDeprecation_before.kt @@ -52,8 +52,8 @@ fun testMany(a: Any) { manyFoo(s = "") manyFoo(a) - manyFoo(v = a) - manyFoo(s = a) + manyFoo(v = a) + manyFoo(s = a) manyFoo(v = a as Int) manyFoo(s = a as String) } diff --git a/compiler/testData/diagnostics/tests/varargs/noAssigningArraysToVarargsFeature.kt b/compiler/testData/diagnostics/tests/varargs/noAssigningArraysToVarargsFeature.kt index c9e446d7eaa..5946f47e662 100644 --- a/compiler/testData/diagnostics/tests/varargs/noAssigningArraysToVarargsFeature.kt +++ b/compiler/testData/diagnostics/tests/varargs/noAssigningArraysToVarargsFeature.kt @@ -11,30 +11,30 @@ annotation class Ann(vararg val s: String) -@Ann(s = arrayOf()) +@Ann(s = arrayOf()) fun test1() {} @Ann(s = intArrayOf()) fun test2() {} -@Ann(s = arrayOf(1)) +@Ann(s = arrayOf(1)) fun test3() {} -@Ann(s = ["value"]) +@Ann(s = ["value"]) fun test5() {} -@JavaAnn(value = arrayOf("value")) +@JavaAnn(value = arrayOf("value")) fun jTest1() {} -@JavaAnn(value = ["value"]) +@JavaAnn(value = ["value"]) fun jTest2() {} -@JavaAnn(value = ["value"], path = ["path"]) +@JavaAnn(value = ["value"], path = ["path"]) fun jTest3() {} annotation class IntAnn(vararg val i: Int) -@IntAnn(i = [1, 2]) +@IntAnn(i = [1, 2]) fun foo1() {} @IntAnn(i = intArrayOf(0)) diff --git a/compiler/testData/diagnostics/tests/when/kt10439.kt b/compiler/testData/diagnostics/tests/when/kt10439.kt index fafc694ac4d..fce2158a3b5 100644 --- a/compiler/testData/diagnostics/tests/when/kt10439.kt +++ b/compiler/testData/diagnostics/tests/when/kt10439.kt @@ -13,12 +13,12 @@ fun foo(x: Int) = x fun test0(flag: Boolean) { - foo(if (flag) true else "") + foo(if (flag) true else "") } fun test1(flag: Boolean) { - foo(when (flag) { - true -> true - else -> "" + foo(when (flag) { + true -> true + else -> "" }) } diff --git a/compiler/testData/diagnostics/tests/when/kt10809.kt b/compiler/testData/diagnostics/tests/when/kt10809.kt index 84dfd3c3d05..29c1db2bf3a 100644 --- a/compiler/testData/diagnostics/tests/when/kt10809.kt +++ b/compiler/testData/diagnostics/tests/when/kt10809.kt @@ -24,7 +24,7 @@ class ListData(val list: List) : Data fun listOf(vararg items: T): List = null!! -fun test1(o: Any) = when (o) { +fun test1(o: Any) = when (o) { is List<*> -> ListData(listOf()) is Int -> when { @@ -51,7 +51,7 @@ fun test1x(o: Any): Data? = when (o) { } fun test2() = - if (true) + if (true) ListData(listOf()) else FlagData(true) @@ -64,4 +64,3 @@ fun test2y(): Any = fun test2z(): Any = run { if (true) ListData(listOf()) else FlagData(true) } - diff --git a/compiler/testData/diagnostics/tests/when/kt9929.kt b/compiler/testData/diagnostics/tests/when/kt9929.kt index cd78501d239..3f65bf8c106 100644 --- a/compiler/testData/diagnostics/tests/when/kt9929.kt +++ b/compiler/testData/diagnostics/tests/when/kt9929.kt @@ -1,7 +1,7 @@ -val test: Int = if (true) { +val test: Int = if (true) { when (2) { 1 -> 1 - else -> null + else -> null } } else { diff --git a/compiler/testData/diagnostics/tests/when/kt9972.kt b/compiler/testData/diagnostics/tests/when/kt9972.kt index dba27d433bc..8a2b11c44d4 100644 --- a/compiler/testData/diagnostics/tests/when/kt9972.kt +++ b/compiler/testData/diagnostics/tests/when/kt9972.kt @@ -10,18 +10,18 @@ */ fun test1(): Int { - val x: String = if (true) { + val x: String = if (true) { when { - true -> Any() - else -> null + true -> Any() + else -> null } } else "" return x.hashCode() } fun test2(): Int { - val x: String = when { - true -> Any() + val x: String = when { + true -> Any() else -> null } ?: return 0 return x.hashCode() diff --git a/compiler/testData/diagnostics/tests/when/whenAndLambdaWithExpectedType.kt b/compiler/testData/diagnostics/tests/when/whenAndLambdaWithExpectedType.kt index bd085494344..cba05bc0377 100644 --- a/compiler/testData/diagnostics/tests/when/whenAndLambdaWithExpectedType.kt +++ b/compiler/testData/diagnostics/tests/when/whenAndLambdaWithExpectedType.kt @@ -29,6 +29,6 @@ val test3: (String) -> Boolean = val test4: (String) -> Boolean = when { - true -> { s1, s2 -> true } + true -> { s1, s2 -> true } else -> null!! } diff --git a/compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt b/compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt index 9edc89979ca..9ed176bd000 100644 --- a/compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt +++ b/compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt @@ -11,8 +11,8 @@ * overload-resolution, determining-function-applicability-for-a-specific-call, description -> paragraph 1 -> sentence 3 */ -val test1 = when { - true -> { { true } } +val test1 = when { + true -> { { true } } else -> TODO() } @@ -21,10 +21,10 @@ val test1a: () -> Boolean = when { else -> TODO() } -val test2 = when { - true -> { { true } } +val test2 = when { + true -> { { true } } else -> when { - true -> { { true } } + true -> { { true } } else -> TODO() } } @@ -32,14 +32,14 @@ val test2 = when { val test2a: () -> Boolean = when { true -> { { true } } else -> when { - true -> { { true } } // TODO + true -> { { true } } // TODO else -> TODO() } } -val test3 = when { - true -> { { true } } - true -> { { true } } +val test3 = when { + true -> { { true } } + true -> { { true } } else -> TODO() } diff --git a/compiler/testData/diagnostics/testsWithStdLib/addAllProjection.kt b/compiler/testData/diagnostics/testsWithStdLib/addAllProjection.kt index 4aeeff61812..1ed95a36e53 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/addAllProjection.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/addAllProjection.kt @@ -1,13 +1,12 @@ - fun test(mc: MutableCollection) { - mc.addAll(mc) + mc.addAll(mc) - mc.addAll(arrayListOf()) + mc.addAll(arrayListOf()) mc.addAll(arrayListOf()) - mc.addAll(listOf("")) - mc.addAll(listOf("")) - mc.addAll(listOf("")) + mc.addAll(listOf("")) + mc.addAll(listOf("")) + mc.addAll(listOf("")) mc.addAll(emptyList()) mc.addAll(emptyList()) diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationApplicability/suppressOnFunctionReference.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationApplicability/suppressOnFunctionReference.kt index 59f075bd98f..71d69e80c8a 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationApplicability/suppressOnFunctionReference.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationApplicability/suppressOnFunctionReference.kt @@ -1,3 +1,3 @@ // See KT-15839 -val x = "1".let(@Suppress("DEPRECATION") Integer::parseInt) +val x = "1".let(@Suppress("DEPRECATION") Integer::parseInt) diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/javaAnnotationWithVarargArgument.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/javaAnnotationWithVarargArgument.kt index f41ac41f44d..24ffbbe08cc 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/javaAnnotationWithVarargArgument.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/javaAnnotationWithVarargArgument.kt @@ -1,10 +1,9 @@ - // FILE: A.java public @interface A { String[] value(); } // FILE: b.kt -@A(*arrayOf(1, "b")) +@A(*arrayOf(1, "b")) fun test() { } diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/kotlinAnnotationWithVarargArgument.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/kotlinAnnotationWithVarargArgument.kt index 67b5cc03b1f..ac0736180f1 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/kotlinAnnotationWithVarargArgument.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/kotlinAnnotationWithVarargArgument.kt @@ -1,6 +1,5 @@ - annotation class B(vararg val args: String) -@B(*arrayOf(1, "b")) +@B(*arrayOf(1, "b")) fun test() { } diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassArrayInAnnotationsInVariance.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassArrayInAnnotationsInVariance.kt index 3db186e15ad..4f3c8271e94 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassArrayInAnnotationsInVariance.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassArrayInAnnotationsInVariance.kt @@ -1,4 +1,3 @@ - import kotlin.reflect.KClass open class A @@ -13,7 +12,7 @@ class MyClass1 @Ann1(arrayOf(Any::class)) class MyClass1a -@Ann1(arrayOf(B1::class)) +@Ann1(arrayOf(B1::class)) class MyClass2 annotation class Ann2(val arg: Array>) @@ -24,5 +23,5 @@ class MyClass3 @Ann2(arrayOf(B1::class)) class MyClass4 -@Ann2(arrayOf(B2::class)) +@Ann2(arrayOf(B2::class)) class MyClass5 diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassArrayInAnnotationsOutVariance.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassArrayInAnnotationsOutVariance.kt index b56f6a6e25f..834992e19db 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassArrayInAnnotationsOutVariance.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassArrayInAnnotationsOutVariance.kt @@ -10,7 +10,7 @@ annotation class Ann1(val arg: Array>) @Ann1(arrayOf(A::class)) class MyClass1 -@Ann1(arrayOf(Any::class)) +@Ann1(arrayOf(Any::class)) class MyClass1a @Ann1(arrayOf(B1::class)) @@ -18,11 +18,11 @@ class MyClass2 annotation class Ann2(val arg: Array>) -@Ann2(arrayOf(A::class)) +@Ann2(arrayOf(A::class)) class MyClass3 @Ann2(arrayOf(B1::class)) class MyClass4 -@Ann2(arrayOf(B2::class)) +@Ann2(arrayOf(B2::class)) class MyClass5 diff --git a/compiler/testData/diagnostics/testsWithStdLib/assert/cast.kt b/compiler/testData/diagnostics/testsWithStdLib/assert/cast.kt index 5385aa77265..6b304dfd080 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/assert/cast.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/assert/cast.kt @@ -10,11 +10,11 @@ class B: A { fun test1(a: A) { assert((a as B).bool()) - a.bool() + a.bool() } fun test2() { val a: A? = null; assert((a as B).bool()) - a?.bool() + a?.bool() } diff --git a/compiler/testData/diagnostics/testsWithStdLib/assert/safeCall.kt b/compiler/testData/diagnostics/testsWithStdLib/assert/safeCall.kt index 1af96ff29fa..11d0efaa78e 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/assert/safeCall.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/assert/safeCall.kt @@ -4,34 +4,33 @@ fun test1(s: String?) { assert(s!!.isEmpty()) - s?.length + s?.length } fun test2(s: String?) { assert(s!!.isEmpty()) - s!!.length + s!!.length } fun test3(s: String?) { assert(s!!.isEmpty()) - s.length + s.length } fun test4() { val s: String? = null; assert(s!!.isEmpty()) - s?.length + s?.length } fun test5() { val s: String? = null; assert(s!!.isEmpty()) - s!!.length + s!!.length } fun test6() { val s: String? = null; assert(s!!.isEmpty()) - s.length + s.length } - diff --git a/compiler/testData/diagnostics/testsWithStdLib/commonCollections.kt b/compiler/testData/diagnostics/testsWithStdLib/commonCollections.kt index 405a0c71626..9dda3d1cc3c 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/commonCollections.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/commonCollections.kt @@ -1,9 +1,8 @@ - import java.util.* fun foo() { val al = ArrayList() al.size - al.contains(1) + al.contains(1) al.contains("") al.remove("") @@ -11,7 +10,7 @@ fun foo() { val hs = HashSet() hs.size - hs.contains(1) + hs.contains(1) hs.contains("") hs.remove("") @@ -19,10 +18,10 @@ fun foo() { val hm = HashMap() hm.size - hm.containsKey(1) + hm.containsKey(1) hm.containsKey("") - hm[1] + hm[1] hm[""] hm.remove("") diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/externalArguments.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/externalArguments.kt index 3104228db12..ea184603188 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/externalArguments.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/externalArguments.kt @@ -5,7 +5,7 @@ import kotlin.reflect.KProperty fun testLambdaArgumentSmartCast(foo: Int?) { val v = run { if (foo != null) - return@run foo + return@run foo 15 } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/applyInsideCoroutine.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/applyInsideCoroutine.kt index 3052e6f85c5..eaf94f2d699 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/applyInsideCoroutine.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/applyInsideCoroutine.kt @@ -7,26 +7,26 @@ class Controller { fun generate(g: suspend Controller.() -> Unit): S = TODO() -val test1 = generate { - apply { - yield(4) +val test1 = generate { + apply { + yield(4) } } -val test2 = generate { +val test2 = generate { yield(B) - apply { - yield(C) + apply { + yield(C) } } -val test3 = generate { - this.let { +val test3 = generate { + this.let { yield(B) } - apply { - yield(C) + apply { + yield(C) } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.kt index 7910630ece8..e4c6654c54d 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.kt @@ -28,7 +28,7 @@ val test1 = generate { baseExtension() } -val test2 = generate { +val test2 = generate { baseExtension() } @@ -37,22 +37,22 @@ val test3 = generate { outNullableAnyExtension() } -val test4 = generate { +val test4 = generate { outNullableAnyExtension() } -val test5 = generate { +val test5 = generate { yield(42) outAnyExtension() } -val test6 = generate { +val test6 = generate { yield("bar") invNullableAnyExtension() } -val test7 = generate { - yield("baz") +val test7 = generate { + yield("baz") genericExtension() } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionsWithNonValuableConstraintsGenericBase.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionsWithNonValuableConstraintsGenericBase.kt index 115445a6c11..fbc9b73aeab 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionsWithNonValuableConstraintsGenericBase.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionsWithNonValuableConstraintsGenericBase.kt @@ -27,11 +27,11 @@ val test1 = generate { yield("foo") } -val test2 = generate { +val test2 = generate { starBase() } -val test3 = generate { +val test3 = generate { yield("bar") stringBase() } @@ -46,6 +46,6 @@ val test5 = generateSpecific { stringBase() } -val test6 = generateSpecific { +val test6 = generateSpecific { stringBase() } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/incorrectCalls.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/incorrectCalls.kt index b4312f8d92f..634ec01b919 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/incorrectCalls.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/incorrectCalls.kt @@ -24,12 +24,12 @@ val test2 = generate { notYield(3) } -val test3 = generate { +val test3 = generate { yield(3) yieldBarReturnType(3) } -val test4 = generate { +val test4 = generate { yield(3) barReturnType() } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/inferCoroutineTypeInOldVersion.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/inferCoroutineTypeInOldVersion.kt index 72ef1eedcd3..d755acd8578 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/inferCoroutineTypeInOldVersion.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/inferCoroutineTypeInOldVersion.kt @@ -16,11 +16,11 @@ val member = build { add(42) } -val memberWithoutAnn = wrongBuild { +val memberWithoutAnn = wrongBuild { add(42) } -val extension = build { +val extension = build { extensionAdd("foo") } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt36220.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt36220.kt index 93fd5d45844..f6cbc1ccaf2 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt36220.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt36220.kt @@ -12,8 +12,8 @@ class TypeDefinition { fun defineType(@BuilderInference definition: TypeDefinition.() -> Unit): Unit = TODO() fun main() { - defineType { + defineType { parse { it.toInt() } - serialize { it.toString() } + serialize { it.toString() } } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/recursiveGenerators2.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/recursiveGenerators2.kt index b569bff1a4e..9aa73a642d8 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/recursiveGenerators2.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/recursiveGenerators2.kt @@ -15,9 +15,9 @@ fun generate(@BuilderInference g: suspend GenericController.() -> Unit): @BuilderInference suspend fun GenericController>.yieldGenerate(g: suspend GenericController.() -> Unit): Unit = TODO() -val test1 = generate { +val test1 = generate { // TODO: KT-15185 - yieldGenerate { + yieldGenerate { yield(4) } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/resolveUsualCallWithBuilderInference.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/resolveUsualCallWithBuilderInference.kt index b55df7a6889..ce06fb70c99 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/resolveUsualCallWithBuilderInference.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/resolveUsualCallWithBuilderInference.kt @@ -23,11 +23,11 @@ val member = build { add(42) } -val memberWithoutAnn = wrongBuild { +val memberWithoutAnn = wrongBuild { add(42) } -val extension = build { +val extension = build { extensionAdd("foo") } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/suspendCallsWithErrors.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/suspendCallsWithErrors.kt index 0e7d974a068..784b7d3be3a 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/suspendCallsWithErrors.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/suspendCallsWithErrors.kt @@ -14,10 +14,10 @@ fun generate(@BuilderInference g: suspend Controller.() -> Unit): S = TOD class A -val test1 = generate { +val test1 = generate { yield(A) } -val test2: Int = generate { - yield(A()) +val test2: Int = generate { + yield(A()) } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/suspendCallsWrongUpperBound.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/suspendCallsWrongUpperBound.kt index 07dd66a6a42..916b60bc8b0 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/suspendCallsWrongUpperBound.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/suspendCallsWrongUpperBound.kt @@ -7,6 +7,6 @@ class Controller { fun generate(g: suspend Controller.() -> Unit): S = TODO() -val test = generate { +val test = generate { yield("foo") } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/useInferenceInformationFromExtension.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/useInferenceInformationFromExtension.kt index c561fbdc54d..86d13bf0ff0 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/useInferenceInformationFromExtension.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/useInferenceInformationFromExtension.kt @@ -23,7 +23,7 @@ val normal = generate { yield(42) } -val extension = generate { +val extension = generate { extensionYield("foo") } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/withUninferredParameter.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/withUninferredParameter.kt index 0719b4dc4d8..4e2499f3c0f 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/withUninferredParameter.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/withUninferredParameter.kt @@ -7,7 +7,7 @@ class GenericController { fun generate(g: suspend GenericController.(S) -> Unit): S = TODO() -val test1 = generate { +val test1 = generate { yield(4) } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt18292.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt18292.kt index 0c7ea8dfdfe..401f6f548e2 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt18292.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt18292.kt @@ -13,6 +13,6 @@ suspend fun fib(n: Long) = async { when { n < 2 -> n - else -> fib(n - 1).await() + fib(n - 2).await() + else -> fib(n - 1).await() + fib(n - 2).await() } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/lambdaExpectedType.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/lambdaExpectedType.kt index f558997fc5f..12d1442698d 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/lambdaExpectedType.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/lambdaExpectedType.kt @@ -20,7 +20,7 @@ fun foo() { builder { 1 } val x = { 1 } - builder(x) + builder(x) builder({1} as (suspend () -> Int)) var i: Int = 1 @@ -31,7 +31,7 @@ fun foo() { genericBuilder { "" } val y = { 1 } - genericBuilder(y) + genericBuilder(y) unitBuilder {} unitBuilder { 1 } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineOrReturn.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineOrReturn.kt index 0eb6b427707..557201ce95a 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineOrReturn.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineOrReturn.kt @@ -18,7 +18,7 @@ class Controller { suspend fun yieldString(value: String) = suspendCoroutineUninterceptedOrReturn { it.resume(1) it checkType { _>() } - it.resume("") + it.resume("") // We can return anything here, 'suspendCoroutineUninterceptedOrReturn' is not very type-safe // Also we can call resume and then return the value too, but it's still just our problem diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendExternalFunctions.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendExternalFunctions.kt index 5897c51aba7..90d12a0b985 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendExternalFunctions.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendExternalFunctions.kt @@ -35,7 +35,7 @@ fun test() { severalParams("", 89) checkType { _() } // TODO: should we allow somehow to call with passing continuation explicitly? - severalParams("", 89, 6.9) checkType { _() } + severalParams("", 89, 6.9) checkType { _() } "".stringReceiver(1) Any().anyReceiver(1) diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctions.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctions.kt index 546b2f4e33a..88e42439738 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctions.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctions.kt @@ -36,7 +36,7 @@ fun test() { severalParams("", 89) checkType { _() } // TODO: should we allow somehow to call with passing continuation explicitly? - severalParams("", 89, 6.9) checkType { _() } - severalParams("", 89, this as Continuation) checkType { _() } + severalParams("", 89, 6.9) checkType { _() } + severalParams("", 89, this as Continuation) checkType { _() } } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/tryCatchLambda.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/tryCatchLambda.kt index 8f60a6c3d23..754b5a833d9 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/tryCatchLambda.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/tryCatchLambda.kt @@ -7,10 +7,10 @@ fun genericBuilder(c: suspend () -> T): T = null!! fun foo() { var result = "" genericBuilder { - try { + try { await("") } catch(e: Exception) { - result = "fail" + result = "fail" } } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/elvisOnJavaList.kt b/compiler/testData/diagnostics/testsWithStdLib/elvisOnJavaList.kt index 863e5f54f9f..1f9cc495860 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/elvisOnJavaList.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/elvisOnJavaList.kt @@ -1,4 +1,3 @@ - // FILE: P.java import java.util.ArrayList; @@ -14,5 +13,5 @@ public class P { fun foo(c: P): MutableList { // Error should be here: see KT-8168 Typechecker fails for platform collection type - return c.getList() ?: listOf() + return c.getList() ?: listOf() } diff --git a/compiler/testData/diagnostics/testsWithStdLib/implicitCastToAny.kt b/compiler/testData/diagnostics/testsWithStdLib/implicitCastToAny.kt index dedba940c8a..c4a9d7390fa 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/implicitCastToAny.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/implicitCastToAny.kt @@ -1,24 +1,23 @@ - var longWords = 0 val smallWords = hashSetOf() fun test1(word: String) = run { if (word.length > 4) { - longWords++ + longWords++ } else { - smallWords.add(word) + smallWords.add(word) } } fun test2(word: String) = run { if (word.length > 4) { - if (word.startsWith("a")) longWords++ + if (word.startsWith("a")) longWords++ } else { - smallWords.add(word) + smallWords.add(word) } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/exactAnnotation.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/exactAnnotation.kt index 2face642281..bf0479c8e92 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/exactAnnotation.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/exactAnnotation.kt @@ -7,5 +7,5 @@ fun test1(l: List) { val i: Int = l.firstTyped() - val s: String = l.firstTyped() + val s: String = l.firstTyped() } diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/kt26698.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/kt26698.kt index 2708e1985b4..737823dfc5e 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/kt26698.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/kt26698.kt @@ -16,6 +16,6 @@ fun <@kotlin.internal.OnlyInputTypes T : Base> fooB(a: T, b: T) {} fun usage(x: CX, y: CY) { foo(x, y) // expected err, got err - fooA(x, y) // expected err, got ok - fooB(x, y) // expected err, got ok + fooA(x, y) // expected err, got ok + fooB(x, y) // expected err, got ok } diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/kt29307.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/kt29307.kt index e508f647e6b..372c24663c2 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/kt29307.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/kt29307.kt @@ -2,7 +2,7 @@ // ISSUE: KT-29307 fun test_1(map: Map) { - val x = map[42] // OK + val x = map[42] // OK } open class A @@ -10,7 +10,7 @@ open class A class B : A() fun test_2(map: Map) { - val x = map[42] + val x = map[42] } fun test_3(m: Map<*, String>) { diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/noInferAndLowPriority.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/noInferAndLowPriority.kt index e71b07198f4..22b90106560 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/noInferAndLowPriority.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/noInferAndLowPriority.kt @@ -10,6 +10,6 @@ public fun Iterable.contains1(element: @kotlin.internal.NoInfer T): Boole fun test() { - val a: Boolean = listOf(1).contains1("") + val a: Boolean = listOf(1).contains1("") val b: Boolean = listOf(1).contains1(1) } diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/noInferAnnotation.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/noInferAnnotation.kt index c7346fdcbd9..b166d665803 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/noInferAnnotation.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/noInferAnnotation.kt @@ -10,23 +10,23 @@ fun @kotlin.internal.NoInfer T.test2(t1: T): T = t1 fun test3(t1: @kotlin.internal.NoInfer T): T = t1 fun usage() { - test1(1, "312") - 1.test2("") - test3("") + test1(1, "312") + 1.test2("") + test3("") } @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") fun List.contains1(e: @kotlin.internal.NoInfer T): Boolean = true fun test(i: Int?, a: Any, l: List) { - l.contains1(a) - l.contains1("") - l.contains1(i) + l.contains1(a) + l.contains1("") + l.contains1(i) } @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") fun assertEquals1(e1: T, e2: @kotlin.internal.NoInfer T): Boolean = true fun test(s: String) { - assertEquals1(s, 11) + assertEquals1(s, 11) } diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAndLowPriority.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAndLowPriority.kt index fac3cf0b7ec..abb2457404d 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAndLowPriority.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAndLowPriority.kt @@ -17,7 +17,7 @@ public fun Map.get1(key: Any?): Int = null!! public fun <@kotlin.internal.OnlyInputTypes K, V> Map.get1(key: K): V? = null!! fun test(map: Map) { - val a: Int = listOf(1).contains1("") + val a: Int = listOf(1).contains1("") val b: Boolean = listOf(1).contains1(1) val c: String? = map.get1("") diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAndTopLevelCapturedTypes.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAndTopLevelCapturedTypes.kt index c513c6303a9..28bb9e6c8b9 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAndTopLevelCapturedTypes.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAndTopLevelCapturedTypes.kt @@ -20,12 +20,12 @@ fun test( invOut.onlyOut(42) invOut.onlyOut(1L) - invOut.onlyOutUB("str") - invStar.onlyOutUB(0) + invOut.onlyOutUB("str") + invStar.onlyOutUB(0) invOut.onlyOutUB(42) invOut.onlyOutUB(1L) - invIn.onlyIn("str") + invIn.onlyIn("str") invIn.onlyIn(42) invIn.onlyIn(1L) } @@ -65,7 +65,7 @@ class Test5 { set(value) { if (value != null) { val a = a - require(a != null && value in a.children) + require(a != null && value in a.children) } field = value } diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesCaptured.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesCaptured.kt index b08fc6713ec..1fef887c722 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesCaptured.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesCaptured.kt @@ -16,7 +16,7 @@ class Out // ------------------------------------------------------- fun test_0(x: Inv2, list: List>) { - list.foo(x) + list.foo(x) } // ------------------------- Inv ------------------------- @@ -34,11 +34,11 @@ fun test_3(x: Inv, list: List>) { } fun test_4(x: Inv, list: List>) { - list.contains1(x) + list.contains1(x) } fun test_5(x: Inv, list: List>) { - list.contains1(x) + list.contains1(x) } fun test_6(x: Inv, list: List>) { diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesUpperBound.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesUpperBound.kt index ec114a88b18..74d2b7ea787 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesUpperBound.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesUpperBound.kt @@ -5,7 +5,7 @@ class Inv class Out fun foo(i: Inv, o: Out) { - bar(i, o) + bar(i, o) } fun <@kotlin.internal.OnlyInputTypes K> bar(r: Inv, o: Out): K = TODO() diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/kt27772.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/kt27772.kt index 31e5a326aee..7f1bc332fe2 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/kt27772.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/kt27772.kt @@ -1,6 +1,5 @@ - fun foo(resources: List) { - resources.map { runCatching { it } }.mapNotNull { it.getOrNull() } + resources.map { runCatching { it } }.mapNotNull { it.getOrNull() } } fun bar(resources: List) { diff --git a/compiler/testData/diagnostics/testsWithStdLib/java/concurrentHashMapContains.kt b/compiler/testData/diagnostics/testsWithStdLib/java/concurrentHashMapContains.kt index e72d8472b34..0bc2a86660d 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/java/concurrentHashMapContains.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/java/concurrentHashMapContains.kt @@ -28,8 +28,8 @@ fun main() { "" in (hm as Map) "" !in (hm as Map) - 1 in (hm as Map) - 1 !in (hm as Map) + 1 in (hm as Map) + 1 !in (hm as Map) val a = A() "" in a @@ -44,8 +44,8 @@ fun main() { "" in (a as Map) "" !in (a as Map) - 1 in (a as Map) - 1 !in (a as Map) + 1 in (a as Map) + 1 !in (a as Map) val b = B() "" in b @@ -58,8 +58,8 @@ fun main() { "" in (b as Map) "" !in (b as Map) - 1 in (b as Map) - 1 !in (b as Map) + 1 in (b as Map) + 1 !in (b as Map) // Actually, we could've allow calls here because the owner explicitly declared as operator, but semantics is still weird val c = C() @@ -73,6 +73,6 @@ fun main() { "" in (c as Map) "" !in (c as Map) - 1 in (c as Map) - 1 !in (c as Map) + 1 in (c as Map) + 1 !in (c as Map) } diff --git a/compiler/testData/diagnostics/testsWithStdLib/java/concurrentHashMapContainsError.kt b/compiler/testData/diagnostics/testsWithStdLib/java/concurrentHashMapContainsError.kt index 4fd107f37c6..3574bd1092f 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/java/concurrentHashMapContainsError.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/java/concurrentHashMapContainsError.kt @@ -28,8 +28,8 @@ fun main() { "" in (hm as Map) "" !in (hm as Map) - 1 in (hm as Map) - 1 !in (hm as Map) + 1 in (hm as Map) + 1 !in (hm as Map) val a = A() "" in a @@ -44,8 +44,8 @@ fun main() { "" in (a as Map) "" !in (a as Map) - 1 in (a as Map) - 1 !in (a as Map) + 1 in (a as Map) + 1 !in (a as Map) val b = B() "" in b @@ -58,8 +58,8 @@ fun main() { "" in (b as Map) "" !in (b as Map) - 1 in (b as Map) - 1 !in (b as Map) + 1 in (b as Map) + 1 !in (b as Map) // Actually, we could've allow calls here because the owner explicitly declared as operator, but semantics is still weird val c = C() @@ -73,6 +73,6 @@ fun main() { "" in (c as Map) "" !in (c as Map) - 1 in (c as Map) - 1 !in (c as Map) + 1 in (c as Map) + 1 !in (c as Map) } diff --git a/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/maps.kt b/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/maps.kt index 4a9780e1474..71a5404ed92 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/maps.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/maps.kt @@ -14,9 +14,9 @@ fun hashMapTest() { x.put(bar(), 1) x.put("", 1) - x[null] = 1 - x[bar()] = 1 - x[""] = nullableInt + x[null] = 1 + x[bar()] = 1 + x[""] = nullableInt x[""] = 1 val b1: MutableMap = x @@ -38,9 +38,9 @@ fun treeMapTest() { x.put(bar(), 1) x.put("", 1) - x[null] = 1 - x[bar()] = 1 - x[""] = nullableInt + x[null] = 1 + x[bar()] = 1 + x[""] = nullableInt x[""] = 1 val b1: MutableMap = x @@ -62,9 +62,9 @@ fun concurrentHashMapTest() { x.put(bar(), 1) x.put("", 1) - x[null] = 1 - x[bar()] = 1 - x[""] = nullableInt + x[null] = 1 + x[bar()] = 1 + x[""] = nullableInt x[""] = 1 val b1: MutableMap = x diff --git a/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/mapsWithNullableKey.kt b/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/mapsWithNullableKey.kt index 00f4da2a757..5cc6b9d2d5c 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/mapsWithNullableKey.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/mapsWithNullableKey.kt @@ -15,7 +15,7 @@ fun hashMapTest() { x[null] = 1 x[bar()] = 1 - x[""] = nullableInt + x[""] = nullableInt x[""] = 1 val b1: MutableMap = x @@ -40,7 +40,7 @@ fun treeMapTest() { x[null] = 1 x[bar()] = 1 - x[""] = nullableInt + x[""] = nullableInt x[""] = 1 val b1: MutableMap = x diff --git a/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/mapsWithNullableValues.kt b/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/mapsWithNullableValues.kt index ad9f38ecdeb..de641bff88f 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/mapsWithNullableValues.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/mapsWithNullableValues.kt @@ -13,8 +13,8 @@ fun hashMapTest() { x.put(bar(), 1) x.put("", 1) - x[null] = 1 - x[bar()] = 1 + x[null] = 1 + x[bar()] = 1 x[""] = nullableInt x[""] = 1 @@ -37,8 +37,8 @@ fun treeMapTest() { x.put(bar(), 1) x.put("", 1) - x[null] = 1 - x[bar()] = 1 + x[null] = 1 + x[bar()] = 1 x[""] = nullableInt x[""] = 1 diff --git a/compiler/testData/diagnostics/testsWithStdLib/regression/kt9820_javaFunctionTypeInheritor.kt b/compiler/testData/diagnostics/testsWithStdLib/regression/kt9820_javaFunctionTypeInheritor.kt index 40b4be9fcac..32873e10661 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/regression/kt9820_javaFunctionTypeInheritor.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/regression/kt9820_javaFunctionTypeInheritor.kt @@ -1,4 +1,3 @@ - // FILE: J.java import kotlin.jvm.functions.Function1; @@ -13,5 +12,5 @@ fun useJ(j: J) { } fun jj() { - useJ({}) + useJ({}) } diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/kt4711.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/kt4711.kt index ba0999324f0..4efea558376 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/kt4711.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/kt4711.kt @@ -6,15 +6,15 @@ fun main() { val startTimeNanos = System.nanoTime() // the problem sits on the next line: - val pi = 4.0.toDouble() * delta * (1..n).reduce( + val pi = 4.0.toDouble() * delta * (1..n).reduce( {t, i -> val x = (i - 0.5) * delta - t + 1.0 / (1.0 + x * x) + t + 1.0 / (1.0 + x * x) }) // !!! pi has error type here val elapseTime = (System.nanoTime() - startTimeNanos) / 1e9 - println("pi_sequential_reduce $pi $n $elapseTime") + println("pi_sequential_reduce $pi $n $elapseTime") } diff --git a/compiler/testData/diagnostics/testsWithStdLib/targetedBuiltIns/unsupportedFeature.kt b/compiler/testData/diagnostics/testsWithStdLib/targetedBuiltIns/unsupportedFeature.kt index 569e6094d48..399a8b4a2d4 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/targetedBuiltIns/unsupportedFeature.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/targetedBuiltIns/unsupportedFeature.kt @@ -27,7 +27,7 @@ interface A2 : List { override fun stream(): java.util.stream.Stream = null!! } -class B : Throwable("", null, false, false) +class B : Throwable("", null, false, false) class B1 : RuntimeException() { override fun fillInStackTrace(): Throwable { // 'override' keyword must be prohibited, as it was in 1.0.x diff --git a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/assignTry.kt b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/assignTry.kt index 1f7a9ff95af..9fd734b03ee 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/assignTry.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/assignTry.kt @@ -11,8 +11,8 @@ fun test2() { catch (e: ExcA) { null } - catch (e: ExcB) { - 10 + catch (e: ExcB) { + 10 } s.length } diff --git a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/falseNegativeSmartcasts_after.kt b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/falseNegativeSmartcasts_after.kt index f59a6f9bbbb..7e7f86a06c0 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/falseNegativeSmartcasts_after.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/falseNegativeSmartcasts_after.kt @@ -13,7 +13,7 @@ fun test1(s1: String?) { return } finally { - s.length + s.length } s.length } diff --git a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/falsePositiveSmartcasts_after.kt b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/falsePositiveSmartcasts_after.kt index 4b5243073a0..e132986cb42 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/falsePositiveSmartcasts_after.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/falsePositiveSmartcasts_after.kt @@ -13,15 +13,15 @@ fun test1() { try { x = null } catch (e: Exception) { - x.length // smartcast shouldn't be allowed (OOME could happen after `x = null`) + x.length // smartcast shouldn't be allowed (OOME could happen after `x = null`) throw e } finally { // smartcast shouldn't be allowed, `x = null` could've happened - x.length + x.length } // smartcast shouldn't be allowed, `x = null` could've happened - x.length + x.length } // With old DFA of try/catch info about unsound smartcasts after try @@ -34,7 +34,7 @@ fun test2() { x = null } catch (e: Exception) { // BAD - x.length + x.length } finally { x.length @@ -50,7 +50,7 @@ fun test3() { } catch (e: Exception) { t2 = null } - t2.not() // wrong smartcast, NPE + t2.not() // wrong smartcast, NPE } } @@ -60,7 +60,7 @@ fun test4() { try { t2 = null } finally { } - t2.not() // wrong smartcast, NPE + t2.not() // wrong smartcast, NPE } } @@ -80,10 +80,10 @@ fun test5() { return } finally { - s1.length - s2.length + s1.length + s2.length } - s1.length + s1.length s2.length } @@ -98,10 +98,10 @@ fun test6(s1: String?, s2: String?) { return } finally { - s.length + s.length requireNotNull(s2) } - s.length - s1.length + s.length + s1.length s2.length } diff --git a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/tryExpression.kt b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/tryExpression.kt index 77b468663c5..a5dd533a84a 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/tryExpression.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/tryExpression.kt @@ -26,9 +26,9 @@ fun test1(): Map = run { } fun test2(): Map = run { - try { + try { emptyMap() } catch (e: ExcA) { - mapOf("" to "") + mapOf("" to "") } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/when/noTypeArgumentsInConstructor.kt b/compiler/testData/diagnostics/testsWithStdLib/when/noTypeArgumentsInConstructor.kt index d8a6e640302..d8ce98a56cf 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/when/noTypeArgumentsInConstructor.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/when/noTypeArgumentsInConstructor.kt @@ -1,4 +1,3 @@ - import java.util.* fun nullable(x: T): T? = x @@ -27,9 +26,9 @@ val test4: Collection = } val test5: Collection = - listOf(1, 2, 3).flatMapTo(LinkedHashSet()) { // TODO + listOf(1, 2, 3).flatMapTo(LinkedHashSet()) { // TODO if (true) listOf(it) else listOf(it) - } + } val test6: Collection = listOf(1, 2, 3).flatMapTo(LinkedHashSet()) { diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg/6.kt b/compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg/6.kt index a12fd9717b0..3d79a616f2e 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg/6.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg/6.kt @@ -36,7 +36,7 @@ fun case_2(a: Any) { fun case_3_1(a: Any) {} fun case_3_2(a: Any) { - case_3_1(a as @Ann(unresolved_reference) String) // OK, no error in IDE and in the compiler + case_3_1(a as @Ann(unresolved_reference) String) // OK, no error in IDE and in the compiler } // TESTCASE NUMBER: 4 diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/neg/1.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/neg/1.kt index 826cb90e88d..331c934aa58 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/neg/1.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/neg/1.kt @@ -65,8 +65,8 @@ fun case_2(value_1: Int?, value_2: Int?, value_3: Any?) { true -> { println(value_3?.xor(true)) println(value_4) - println(value_1.inv()) - println(value_2.inv()) + println(value_1.inv()) + println(value_2.inv()) } false -> { println(value_4) diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/1.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/1.kt index 730bafb89ef..ffed2829937 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/1.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/1.kt @@ -19,13 +19,13 @@ fun case_1(value_1: Any?) { // TESTCASE NUMBER: 2 fun case_2(value_1: Int?) { funWithReturnsAndInvertCondition(value_1 != null) - println(value_1.inc()) + println(value_1.inc()) } // TESTCASE NUMBER: 3 fun case_3(value_1: Int?) { funWithReturns(value_1 == null) - println(value_1.inc()) + println(value_1.inc()) } // TESTCASE NUMBER: 4 @@ -37,13 +37,13 @@ fun case_4(value_1: Any?) { // TESTCASE NUMBER: 5 fun case_5(value_1: String?) { funWithReturnsAndNullCheck(value_1) - println(value_1.length) + println(value_1.length) } // TESTCASE NUMBER: 6 fun case_6(value_1: String?) { funWithReturnsAndNullCheck(value_1) - println(value_1.length) + println(value_1.length) } // TESTCASE NUMBER: 7 @@ -52,7 +52,7 @@ object case_7_object { } fun case_7() { funWithReturns(case_7_object.prop_1 == null) - case_7_object.prop_1.inc() + case_7_object.prop_1.inc() } // TESTCASE NUMBER: 8 diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/2.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/2.kt index 584a04960cf..d89bd31269b 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/2.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/2.kt @@ -162,7 +162,7 @@ class case_10_class { // TESTCASE NUMBER: 11 fun case_11(value_1: Any?, value_2: Any?, value_3: Any?) { funWithReturnsAndInvertCondition(value_1 !is String? || value_2 !is Number && value_3 !is Float) - println(value_1!!.length) + println(value_1!!.length) println(value_2.toByte()) println(value_3.dec()) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/4.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/4.kt index ac8f7e9f4a5..16862bb8e23 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/4.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/4.kt @@ -159,7 +159,7 @@ fun case_2(value_1: Number) { // TESTCASE NUMBER: 3 fun case_3(value_1: String?, value_2: String?) { value_1.case_3_1() - println(value_1.length) + println(value_1.length) value_2.case_3_2() println(value_2) } @@ -167,7 +167,7 @@ fun case_3(value_1: String?, value_2: String?) { // TESTCASE NUMBER: 4 fun case_4(value_1: String?, value_2: String?) { value_1.case_4_1() - println(value_1.length) + println(value_1.length) value_2.case_4_2() println(value_2) } @@ -190,7 +190,7 @@ fun case_6(value_1: Number) { // TESTCASE NUMBER: 7 fun case_7(value_1: String?, value_2: String?) { - if (value_1.case_7_1()) println(value_1.length) + if (value_1.case_7_1()) println(value_1.length) if (value_2.case_7_2()) println(value_2) if (!(value_2.case_7_3() == null)) println(value_2) if (value_2.case_7_3() == null) println(value_2) @@ -198,7 +198,7 @@ fun case_7(value_1: String?, value_2: String?) { // TESTCASE NUMBER: 8 fun case_8(value_1: String?, value_2: String?) { - when { value_1.case_8_1() -> println(value_1.length) } + when { value_1.case_8_1() -> println(value_1.length) } when { value_2.case_8_2() -> println(value_2) } when { !(value_2.case_8_3() == null) -> println(value_2) } when { value_2.case_8_3() == null -> println(value_2) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/7.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/7.kt index ba9f89b324e..c60522e991f 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/7.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/7.kt @@ -217,7 +217,7 @@ import contracts.* // TESTCASE NUMBER: 1 fun case_1(value_1: Int?) { case_1_1(value_1) - value_1.inv() + value_1.inv() case_1_2(value_1) value_1.inv() case_1_1(value_1) @@ -245,15 +245,15 @@ fun case_4(value_1: Any?) { case_4_1(value_1) value_1?.toByte() case_4_2(value_1) - value_1.toByte() + value_1.toByte() case_4_3(value_1) - value_1.inv() + value_1.inv() } // TESTCASE NUMBER: 5 fun case_5(value_1: Int?) { if (case_5_1(value_1)) { - value_1.inv() + value_1.inv() if (case_5_2(value_1)) { value_1.inv() case_5_1(value_1) @@ -261,7 +261,7 @@ fun case_5(value_1: Int?) { } } if (!case_5_3(value_1)) { - value_1.inv() + value_1.inv() if (!case_5_4(value_1)) { value_1.inv() case_5_1(value_1) @@ -269,7 +269,7 @@ fun case_5(value_1: Int?) { } } if (case_5_5(value_1) != null) { - value_1.inv() + value_1.inv() if (case_5_6(value_1) != null) { value_1.inv() case_5_1(value_1) @@ -277,7 +277,7 @@ fun case_5(value_1: Int?) { } } if (case_5_7(value_1) == null) { - value_1.inv() + value_1.inv() if (case_5_8(value_1) == null) { value_1.inv() case_5_1(value_1) @@ -339,29 +339,29 @@ fun case_8(value_1: Any?) { if (case_8_1(value_1)) { value_1?.toByte() if (case_8_2(value_1)) { - value_1.toByte() - if (case_8_3(value_1)) value_1.inv() + value_1.toByte() + if (case_8_3(value_1)) value_1.inv() } } if (!case_8_4(value_1)) { value_1?.toByte() if (!case_8_5(value_1)) { - value_1.toByte() - if (!case_8_6(value_1)) value_1.inv() + value_1.toByte() + if (!case_8_6(value_1)) value_1.inv() } } if (case_8_7(value_1) == null) { value_1?.toByte() if (case_8_8(value_1) != null) { - value_1.toByte() - if (case_8_9(value_1) != null) value_1.inv() + value_1.toByte() + if (case_8_9(value_1) != null) value_1.inv() } } if (case_8_10(value_1) != null) { value_1?.toByte() if (case_8_11(value_1) == null) { - value_1.toByte() - if (case_8_12(value_1) == null) value_1.inv() + value_1.toByte() + if (case_8_12(value_1) == null) value_1.inv() } } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/8.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/8.kt index 34209919d59..ebb360f8c21 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/8.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/8.kt @@ -103,7 +103,7 @@ fun case_4(value_1: Number, value_2: (() -> Unit)?) { } else if (contracts.case_4(value_1, value_2) == false) { println(value_2) } else if (contracts.case_4(value_1, value_2) == null) { - value_2() + value_2() } } @@ -112,10 +112,10 @@ fun case_5(value_1: Number?, value_2: String?) { when (value_2.case_5(value_1)) { true -> { println(value_2.length) - println(value_1.toByte()) + println(value_1.toByte()) } false -> { - println(value_2.length) + println(value_2.length) println(value_1.inv()) } } @@ -125,7 +125,7 @@ fun case_5(value_1: Number?, value_2: String?) { fun case_6(value_1: Number, value_2: String?, value_3: Any?) { when (value_3.case_6(value_1, value_2)) { true -> { - println(value_3.equals("")) + println(value_3.equals("")) println(value_2.length) } false -> { diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/2.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/2.kt index ad0763e7266..a64dc63979e 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/2.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/2.kt @@ -167,6 +167,6 @@ class case_10_class { */ fun case_11(value_1: Any?, value_2: Any?, value_3: Any?) { funWithReturnsAndInvertCondition(value_1 !is String || value_2 !is Number || value_3 !is Any?) - println(value_1!!.length) + println(value_1!!.length) println(value_2?.toByte()) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/4.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/4.kt index dab0535d913..d5e704bb9bf 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/4.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/4.kt @@ -228,11 +228,11 @@ fun case_7(value_1: String?) { } when { value_1.case_7_10() == null -> println(value_1) - value_1.case_7_10() != null -> println(value_1) + value_1.case_7_10() != null -> println(value_1) } when { value_1.case_7_11() != null -> println(value_1) - value_1.case_7_11() == null -> println(value_1) + value_1.case_7_11() == null -> println(value_1) } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/8.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/8.kt index 69d44d2df6b..c3cdf80638d 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/8.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/8.kt @@ -89,7 +89,7 @@ fun case_3(value_1: Int?, value_2: Any?) { if (!value_1.case_3(value_1, value_2 is Number?)) { println(value_2?.toByte()) println(value_1.inv()) - } else if (value_1.case_3(value_1, value_2 is Number?)) { + } else if (value_1.case_3(value_1, value_2 is Number?)) { println(value_1) } else { println(value_1.inv()) diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common/neg/5.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common/neg/5.kt index ebee246c2f7..9cb5a454022 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common/neg/5.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common/neg/5.kt @@ -40,7 +40,7 @@ fun case_4(): Boolean? { // TESTCASE NUMBER: 5 fun case_5(): Boolean? { - contract { returns(null) implies listOf(0) } + contract { returns(null) implies listOf(0) } return null } @@ -67,4 +67,4 @@ fun case_8(): () -> Unit { callsInPlace(case_8(), InvocationKind.EXACTLY_ONCE) } return {} -} \ No newline at end of file +} diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/noReturnType.kt b/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/noReturnType.kt index f37a5d322b7..8b5680bf3e7 100644 --- a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/noReturnType.kt +++ b/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/noReturnType.kt @@ -10,7 +10,7 @@ public interface Sam { annotation class SamWithReceiver fun test() { - Sam { a, b -> + Sam { a, b -> System.out.println(a) } @@ -18,4 +18,4 @@ fun test() { val a: String = this System.out.println(a) } -} \ No newline at end of file +} diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samConversionSimple.kt b/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samConversionSimple.kt index 34d2dec022a..e9e10a8cdae 100644 --- a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samConversionSimple.kt +++ b/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samConversionSimple.kt @@ -17,6 +17,6 @@ annotation class SamWithReceiver fun test() { val e = Exec() - e.exec { a -> System.out.println(a) } + e.exec { a -> System.out.println(a) } e.exec { System.out.println(this) } -} \ No newline at end of file +} diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samWithAnnotation.kt b/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samWithAnnotation.kt index 1c7425fa3af..088d2730513 100644 --- a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samWithAnnotation.kt +++ b/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samWithAnnotation.kt @@ -10,7 +10,7 @@ public interface Sam { annotation class SamWithReceiver fun test() { - Sam { a, b -> + Sam { a, b -> System.out.println(a) "" } @@ -20,4 +20,4 @@ fun test() { System.out.println(a) "" } -} \ No newline at end of file +} diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samWithoutAnnotation.kt b/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samWithoutAnnotation.kt index a2e00d31562..f3b39f00d07 100644 --- a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samWithoutAnnotation.kt +++ b/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samWithoutAnnotation.kt @@ -12,9 +12,9 @@ fun test() { "" } - Sam { b -> + Sam { b -> val a = this@Sam - System.out.println(a) + System.out.println(a) "" } -} \ No newline at end of file +} diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/singleParameter.kt b/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/singleParameter.kt index 97615e88e55..928f763f5d6 100644 --- a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/singleParameter.kt +++ b/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/singleParameter.kt @@ -10,8 +10,8 @@ public interface Sam { annotation class SamWithReceiver fun test() { - Sam { a -> - System.out.println(a) + Sam { a -> + System.out.println(a) } Sam { @@ -19,4 +19,4 @@ fun test() { val a2: String = it System.out.println(a) } -} \ No newline at end of file +} diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/singleParameterWithoutAnnotation.kt b/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/singleParameterWithoutAnnotation.kt index e8e10528104..9d1c651fea8 100644 --- a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/singleParameterWithoutAnnotation.kt +++ b/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/singleParameterWithoutAnnotation.kt @@ -13,6 +13,6 @@ fun test() { Sam { val a = this - System.out.println(a) + System.out.println(a) } -} \ No newline at end of file +}