diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/nestedCallWithOverload.kt b/compiler/testData/diagnostics/tests/callableReference/generic/nestedCallWithOverload.kt index 776bf38aabd..a7f6ea032ac 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/nestedCallWithOverload.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/nestedCallWithOverload.kt @@ -7,16 +7,16 @@ fun id(x: T): T = x fun baz(x: T, y: T): T = TODO() fun test() { - val x1: (Int) -> Unit = id(id(::foo)) - 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 x1: (Int) -> Unit = id(id(::foo)) + 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))) - id<(Int) -> Unit>(id(id(::foo))) - id(id<(Int) -> Unit>(::foo)) - baz<(Int) -> Unit>(id(::foo), id(id(::foo))) - baz(id(::foo), id(id<(Int) -> Unit>(::foo))) - baz(id(::foo), id<(Int) -> Unit>(id(::foo))) + id<(Int) -> Unit>(id(id(::foo))) + id(id<(Int) -> Unit>(::foo)) + baz<(Int) -> Unit>(id(::foo), id(id(::foo))) + baz(id(::foo), id(id<(Int) -> Unit>(::foo))) + baz(id(::foo), id<(Int) -> Unit>(id(::foo))) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/elvisNotProcessed.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/elvisNotProcessed.kt index e17ee5b0c38..97f02366f36 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/elvisNotProcessed.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/elvisNotProcessed.kt @@ -34,6 +34,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/throwInLambda.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/throwInLambda.kt index 08216a5ae4b..66acefa676d 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/throwInLambda.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/throwInLambda.kt @@ -8,6 +8,6 @@ fun foo(): String { } fun bar(): String { val x = fn() ?: return "" - val y = x?.let { throw Exception() } ?: "unreachable" - return y + val y = x?.let { throw Exception() } ?: "unreachable" + return y } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/controlStructures/ifElseIntersection.kt b/compiler/testData/diagnostics/tests/controlStructures/ifElseIntersection.kt index dd65c299a0c..c9565393ff3 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/ifElseIntersection.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/ifElseIntersection.kt @@ -11,7 +11,7 @@ fun bind(r: Option): Option { // Ideally we should infer Option here (see KT-10896) (if (true) None() else r) checkType { _>() } // Works correctly - if (true) None() else r + if (true) None() else r } else r } @@ -25,7 +25,7 @@ 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 } @@ -36,7 +36,7 @@ fun bindWhen(r: Option): Option { return when (r) { is Some -> { // Works correctly - if (true) None() else r + if (true) None() else r } else -> r } 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 0a13e7501ed..a0f4d3b4d35 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/kt770.kt351.kt735_StatementType.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/kt770.kt351.kt735_StatementType.kt @@ -108,7 +108,7 @@ fun testImplicitCoercion() { val h = if (false) 4 else {} bar(if (true) { - 4 + 4 } else { z = 342 diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/BinaryExpression.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/BinaryExpression.kt index 48408d23083..46ae3651bf0 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/BinaryExpression.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/BinaryExpression.kt @@ -6,6 +6,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/dataFlowInfoTraversal/ExclExcl.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/ExclExcl.kt index 4499a4f5fe8..217749462c2 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/ExclExcl.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/ExclExcl.kt @@ -4,7 +4,7 @@ fun bar(x: Int) = x + 1 fun f1(x: Int?) { bar(x) if (x != null) bar(x!!) - if (x == null) bar(x!!) + if (x == null) bar(x!!) } fun f2(x: Int?) { diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethods.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethods.kt index dd4bb974523..7c37eaa8ce6 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethods.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethods.kt @@ -3,7 +3,7 @@ import kotlin.reflect.KProperty var a: Int by A() -var a1 by A() +var a1 by A() var b: Int by B() diff --git a/compiler/testData/diagnostics/tests/deparenthesize/checkDeparenthesizedType.kt b/compiler/testData/diagnostics/tests/deparenthesize/checkDeparenthesizedType.kt index 8e89a8ad7f3..f03833ab722 100644 --- a/compiler/testData/diagnostics/tests/deparenthesize/checkDeparenthesizedType.kt +++ b/compiler/testData/diagnostics/tests/deparenthesize/checkDeparenthesizedType.kt @@ -19,8 +19,8 @@ fun test(i: Int?) { foo(l4@ "") foo(("")) - foo(checkSubtype("")) - foo(checkSubtype("")) + foo(checkSubtype("")) + foo(checkSubtype("")) use(a, b, c, d) } diff --git a/compiler/testData/diagnostics/tests/functionAsExpression/InferenceParametersTypes.kt b/compiler/testData/diagnostics/tests/functionAsExpression/InferenceParametersTypes.kt index b458f865a91..6b034e53e90 100644 --- a/compiler/testData/diagnostics/tests/functionAsExpression/InferenceParametersTypes.kt +++ b/compiler/testData/diagnostics/tests/functionAsExpression/InferenceParametersTypes.kt @@ -12,7 +12,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/functionLiterals/destructuringInLambdas/complexInference.kt b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/complexInference.kt index d7e65afe274..a921616a278 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/complexInference.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/complexInference.kt @@ -30,7 +30,7 @@ fun bar(aInstance: A, bInstance: B) { d checkType { _() } } - foo(bInstance) { + foo(bInstance) { (a, b), (c, d) -> a checkType { _() } b checkType { _() } diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/addAll.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/addAll.kt index f2733e73843..632964f50a1 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/addAll.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/addAll.kt @@ -24,7 +24,7 @@ fun foo(x: MC) { x.addAll(mc()) x.addAllMC(mc()) - x.addAll(c()) + x.addAll(c()) x.addAll(c()) x.addAllInv(mc()) diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/typeMismatchInLambda.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/typeMismatchInLambda.kt index 31dcc4a698c..ae517f771ab 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/typeMismatchInLambda.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/typeMismatchInLambda.kt @@ -17,7 +17,7 @@ fun test(a: A, z: Out) { "" } a.bar { Out() } - a.bar { Out() } + a.bar { Out() } a.bar { z.id() } a.foo { diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/typeParameterBounds.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/typeParameterBounds.kt index cced4843383..754cb50168e 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/typeParameterBounds.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/typeParameterBounds.kt @@ -14,12 +14,12 @@ class A { fun foo2(a: A, b: A) { a.foo1(Out()) - a.foo1<Out>(Out()) + a.foo1<Out>(Out()) - a.foo1(Out()) + a.foo1(Out()) a.foo1(Out()) - a.foo2(Inv()) + a.foo2(Inv()) a.foo2(Inv()) a.foo2<Inv>(Inv()) @@ -31,7 +31,7 @@ fun foo2(a: A, b: A) { b.foo1(Out()) b.foo1>(Out()) - b.foo2(Inv()) + b.foo2(Inv()) b.foo2(Inv()) b.foo2<Inv>(Inv()) diff --git a/compiler/testData/diagnostics/tests/generics/tpAsReified/InFunction.kt b/compiler/testData/diagnostics/tests/generics/tpAsReified/InFunction.kt index 13c63d50eb8..475d4360ae9 100644 --- a/compiler/testData/diagnostics/tests/generics/tpAsReified/InFunction.kt +++ b/compiler/testData/diagnostics/tests/generics/tpAsReified/InFunction.kt @@ -6,7 +6,7 @@ inline fun f(): T = throw UnsupportedOperationException() fun id(p: T): T = p fun main() { - f() + f() val a: A = f() f<A>() @@ -14,5 +14,5 @@ fun main() { val b: Int = f() f() - val с: A = id(f()) + val с: A = id(f()) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/incompleteCode/checkNothingIsSubtype.kt b/compiler/testData/diagnostics/tests/incompleteCode/checkNothingIsSubtype.kt index 32df9a0b9aa..28e8c2da190 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/checkNothingIsSubtype.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/checkNothingIsSubtype.kt @@ -7,7 +7,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/diagnosticWithSyntaxError/noTypeParamsInReturnType.kt b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/noTypeParamsInReturnType.kt index 000c4a3e735..3155721577f 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/noTypeParamsInReturnType.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/noTypeParamsInReturnType.kt @@ -6,6 +6,6 @@ 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 2257b30c43b..3000bcfb85d 100644 --- a/compiler/testData/diagnostics/tests/inference/NoInferenceFromDeclaredBounds.kt +++ b/compiler/testData/diagnostics/tests/inference/NoInferenceFromDeclaredBounds.kt @@ -7,6 +7,6 @@ fun foo1() { fooT22() } -val n : Nothing = null.sure() +val n : Nothing = null.sure() fun T?.sure() : T = this!! diff --git a/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithExpectedType.kt b/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithExpectedType.kt index ee12000834a..c0fda0307c8 100644 --- a/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithExpectedType.kt +++ b/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithExpectedType.kt @@ -22,5 +22,5 @@ val b: () -> Unit = l@{ val c: () -> Unit = { // Interesting enough, for such expessions we use expected type Unit // (compare that with the previous case, where we didn't used expected type Unit for "hello") - materialize() + materialize() } diff --git a/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithExpectedTypeAndBound.kt b/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithExpectedTypeAndBound.kt index c86551c0788..18434688c14 100644 --- a/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithExpectedTypeAndBound.kt +++ b/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithExpectedTypeAndBound.kt @@ -8,6 +8,6 @@ fun a(): Unit = run { fun b(): Unit = run { run { - materializeNumber() + materializeNumber() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithoutExpectedType.kt b/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithoutExpectedType.kt index 2125a3976f3..81176e8df24 100644 --- a/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithoutExpectedType.kt +++ b/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithoutExpectedType.kt @@ -14,6 +14,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() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/coercionToUnit/indirectCoercionWithExpectedType.kt b/compiler/testData/diagnostics/tests/inference/coercionToUnit/indirectCoercionWithExpectedType.kt index ed127b74913..c66b34becf2 100644 --- a/compiler/testData/diagnostics/tests/inference/coercionToUnit/indirectCoercionWithExpectedType.kt +++ b/compiler/testData/diagnostics/tests/inference/coercionToUnit/indirectCoercionWithExpectedType.kt @@ -11,7 +11,7 @@ fun a(): Unit = run { fun b(): Unit = run { // Ok, expected type is applied - materialize() + materialize() } fun c(): Unit = run { @@ -19,13 +19,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/constraints/ignoreConstraintFromImplicitInNothing.kt b/compiler/testData/diagnostics/tests/inference/constraints/ignoreConstraintFromImplicitInNothing.kt index 59cb039ada0..1fa3586927a 100644 --- a/compiler/testData/diagnostics/tests/inference/constraints/ignoreConstraintFromImplicitInNothing.kt +++ b/compiler/testData/diagnostics/tests/inference/constraints/ignoreConstraintFromImplicitInNothing.kt @@ -9,8 +9,8 @@ inline fun foo2(f: (T) -> Unit): Foo = Foo() fun test1() { val f1: Foo = foo1 { it checkType { _() } } - val f2: Foo = foo1 { it checkType { _() } } + val f2: Foo = foo1 { it checkType { _() } } val f3: Foo = foo2 { it checkType { _() } } - val f4: Foo = foo2 { it checkType { _() } } + val f4: Foo = foo2 { it checkType { _() } } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/constraints/returnLambdaFromLambda.kt b/compiler/testData/diagnostics/tests/inference/constraints/returnLambdaFromLambda.kt index c6880126246..ad3b409b6fd 100644 --- a/compiler/testData/diagnostics/tests/inference/constraints/returnLambdaFromLambda.kt +++ b/compiler/testData/diagnostics/tests/inference/constraints/returnLambdaFromLambda.kt @@ -9,13 +9,13 @@ fun testLambda() { { it -> x + it } } - val twoLambda: (Int) -> Int = myRun { + val twoLambda: (Int) -> Int = myRun { val x: Int = 1 - run { + run { val y: Int = 2 { x + y } - } - } + } + } } diff --git a/compiler/testData/diagnostics/tests/inference/expectedTypeAdditionalTest.kt b/compiler/testData/diagnostics/tests/inference/expectedTypeAdditionalTest.kt index bcc0b4b930c..4b0cc5f4f2a 100644 --- a/compiler/testData/diagnostics/tests/inference/expectedTypeAdditionalTest.kt +++ b/compiler/testData/diagnostics/tests/inference/expectedTypeAdditionalTest.kt @@ -7,7 +7,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 \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/expectedTypeDoubleReceiver.kt b/compiler/testData/diagnostics/tests/inference/expectedTypeDoubleReceiver.kt index 834a6bf8406..64adc92aaa6 100644 --- a/compiler/testData/diagnostics/tests/inference/expectedTypeDoubleReceiver.kt +++ b/compiler/testData/diagnostics/tests/inference/expectedTypeDoubleReceiver.kt @@ -9,10 +9,10 @@ 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 diff --git a/compiler/testData/diagnostics/tests/inference/expectedTypeFromCast.kt b/compiler/testData/diagnostics/tests/inference/expectedTypeFromCast.kt index 6458645d350..763197f2be3 100644 --- a/compiler/testData/diagnostics/tests/inference/expectedTypeFromCast.kt +++ b/compiler/testData/diagnostics/tests/inference/expectedTypeFromCast.kt @@ -7,7 +7,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) @@ -17,5 +17,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/functionPlaceholderError.kt b/compiler/testData/diagnostics/tests/inference/functionPlaceholderError.kt index 0d8588abd95..c80d41d6f80 100644 --- a/compiler/testData/diagnostics/tests/inference/functionPlaceholderError.kt +++ b/compiler/testData/diagnostics/tests/inference/functionPlaceholderError.kt @@ -11,5 +11,5 @@ fun test() { val q = foo(fun Int.() {}, emptyList()) //type inference no information for parameter error checkSubtype(q) - foo({}, emptyList()) + foo({}, emptyList()) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/kt28654.kt b/compiler/testData/diagnostics/tests/inference/kt28654.kt index 38096364d53..cf734d7057a 100644 --- a/compiler/testData/diagnostics/tests/inference/kt28654.kt +++ b/compiler/testData/diagnostics/tests/inference/kt28654.kt @@ -6,5 +6,5 @@ fun select(): K = val t = select() + val t = select() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/kt6175.kt b/compiler/testData/diagnostics/tests/inference/kt6175.kt index 2f03e3681df..e8528f64c10 100644 --- a/compiler/testData/diagnostics/tests/inference/kt6175.kt +++ b/compiler/testData/diagnostics/tests/inference/kt6175.kt @@ -16,10 +16,10 @@ fun test1() { fun bar(body: (R) -> T): T = fail() fun test2() { - bar { + bar { true } - bar { x -> + bar { x -> true } } @@ -27,10 +27,10 @@ fun test2() { fun baz(body: (List) -> T): T = fail() fun test3() { - baz { + baz { true } - baz { x -> + baz { x -> true } } diff --git a/compiler/testData/diagnostics/tests/inference/nestedCalls/binaryExpressions.kt b/compiler/testData/diagnostics/tests/inference/nestedCalls/binaryExpressions.kt index 1d553689322..3a58828b7f6 100644 --- a/compiler/testData/diagnostics/tests/inference/nestedCalls/binaryExpressions.kt +++ b/compiler/testData/diagnostics/tests/inference/nestedCalls/binaryExpressions.kt @@ -24,7 +24,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()) @@ -56,7 +56,7 @@ fun test3(z: Z) { //'in' operation fun test4(collection: Collection>) { - id(newA() in collection) + id(newA() in collection) id(newA() in collection) } diff --git a/compiler/testData/diagnostics/tests/inference/recursiveLocalFuns/selfCall.kt b/compiler/testData/diagnostics/tests/inference/recursiveLocalFuns/selfCall.kt index 029c77abb9d..b06b0bbe2f0 100644 --- a/compiler/testData/diagnostics/tests/inference/recursiveLocalFuns/selfCall.kt +++ b/compiler/testData/diagnostics/tests/inference/recursiveLocalFuns/selfCall.kt @@ -3,7 +3,7 @@ fun foo() { fun bar1() = bar1() fun bar2() = 1 + bar2() - fun bar3() = id(bar3()) + fun bar3() = id(bar3()) } fun id(x: T) = x diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2445.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2445.kt index 6f3cdeb2bb1..d59e9d80967 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2445.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2445.kt @@ -4,7 +4,7 @@ package a fun main() { - test { + test { } } diff --git a/compiler/testData/diagnostics/tests/inference/reportAboutUnresolvedReferenceAsUnresolved.kt b/compiler/testData/diagnostics/tests/inference/reportAboutUnresolvedReferenceAsUnresolved.kt index 27540748926..981ce628885 100644 --- a/compiler/testData/diagnostics/tests/inference/reportAboutUnresolvedReferenceAsUnresolved.kt +++ b/compiler/testData/diagnostics/tests/inference/reportAboutUnresolvedReferenceAsUnresolved.kt @@ -3,5 +3,5 @@ fun T.map(f: (T) -> U) = f(this) fun consume(s: String) {} fun test() { - consume(1.map(::foo)) + consume(1.map(::foo)) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/reportingImprovements/typeInferenceFailedOnComponentN.kt b/compiler/testData/diagnostics/tests/inference/reportingImprovements/typeInferenceFailedOnComponentN.kt index fd7632cc51e..61c1b5b6ad0 100644 --- a/compiler/testData/diagnostics/tests/inference/reportingImprovements/typeInferenceFailedOnComponentN.kt +++ b/compiler/testData/diagnostics/tests/inference/reportingImprovements/typeInferenceFailedOnComponentN.kt @@ -6,5 +6,5 @@ class X operator fun X.component1(): T = TODO() fun test() { - val (y) = X() + val (y) = X() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/reportingImprovements/typeInferenceFailedOnIteratorCall.kt b/compiler/testData/diagnostics/tests/inference/reportingImprovements/typeInferenceFailedOnIteratorCall.kt index 6775de48f48..001a1300acc 100644 --- a/compiler/testData/diagnostics/tests/inference/reportingImprovements/typeInferenceFailedOnIteratorCall.kt +++ b/compiler/testData/diagnostics/tests/inference/reportingImprovements/typeInferenceFailedOnIteratorCall.kt @@ -4,6 +4,6 @@ class X operator fun X.iterator(): Iterable = TODO() fun test() { - for (i in X()) { + for (i in X()) { } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/upperBounds/doNotInferFromBoundsOnly.kt b/compiler/testData/diagnostics/tests/inference/upperBounds/doNotInferFromBoundsOnly.kt index 890406fbb56..370007423b0 100644 --- a/compiler/testData/diagnostics/tests/inference/upperBounds/doNotInferFromBoundsOnly.kt +++ b/compiler/testData/diagnostics/tests/inference/upperBounds/doNotInferFromBoundsOnly.kt @@ -6,7 +6,7 @@ interface A fun emptyList(): List = throw Exception() fun test1() { - emptyList() + emptyList() } //-------------- diff --git a/compiler/testData/diagnostics/tests/j+k/flexibleNothing.kt b/compiler/testData/diagnostics/tests/j+k/flexibleNothing.kt index 3ced22857a0..f5596d04f2e 100644 --- a/compiler/testData/diagnostics/tests/j+k/flexibleNothing.kt +++ b/compiler/testData/diagnostics/tests/j+k/flexibleNothing.kt @@ -10,7 +10,7 @@ public class TestClass { fun run() { val testClass = TestClass() // inferred as `set()`, return type is Nothing! - testClass.set("test", null) + testClass.set("test", null) // Should not be unreachable run() diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2164.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2164.kt index 0b4f9a7dc02..89b5caa154a 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2164.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2164.kt @@ -23,8 +23,8 @@ fun main() { foo(x) } else { foo(x) - foo(x!!) - foo(x) + foo(x!!) + foo(x) } foo(x) diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/unnecessaryNotNullAssertion.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/unnecessaryNotNullAssertion.kt index a1e9a09a30d..ba32926959c 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/unnecessaryNotNullAssertion.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/unnecessaryNotNullAssertion.kt @@ -7,18 +7,18 @@ fun nullable(): T? = null fun dependOn(x: T) = x fun test() { - takeNotNull(notNull()!!) - takeNotNull(nullable()!!) + takeNotNull(notNull()!!) + takeNotNull(nullable()!!) - var x: String? = null - takeNotNull(dependOn(x)!!) - takeNotNull(dependOn(dependOn(x))!!) - takeNotNull(dependOn(dependOn(x)!!)) - takeNotNull(dependOn(dependOn(x!!))) + var x: String? = null + takeNotNull(dependOn(x)!!) + takeNotNull(dependOn(dependOn(x))!!) + takeNotNull(dependOn(dependOn(x)!!)) + takeNotNull(dependOn(dependOn(x!!))) - if (x != null) { + if (x != null) { takeNotNull(dependOn(x)!!) takeNotNull(dependOn(dependOn(x))!!) takeNotNull(dependOn(dependOn(x)!!)) - } + } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/nullableTypes/uselessElvis.kt b/compiler/testData/diagnostics/tests/nullableTypes/uselessElvis.kt index 2f57ac79a41..d9c9b402054 100644 --- a/compiler/testData/diagnostics/tests/nullableTypes/uselessElvis.kt +++ b/compiler/testData/diagnostics/tests/nullableTypes/uselessElvis.kt @@ -22,21 +22,21 @@ fun nullable(): T? = null fun dependOn(x: T) = x fun test() { - takeNotNull(notNull() ?: "") - takeNotNull(nullable() ?: "") + takeNotNull(notNull() ?: "") + takeNotNull(nullable() ?: "") - val x: String? = null - takeNotNull(dependOn(x) ?: "") - takeNotNull(dependOn(dependOn(x)) ?: "") - takeNotNull(dependOn(dependOn(x as String)) ?: "") + val x: String? = null + takeNotNull(dependOn(x) ?: "") + takeNotNull(dependOn(dependOn(x)) ?: "") + takeNotNull(dependOn(dependOn(x as String)) ?: "") - if (x != null) { + if (x != null) { takeNotNull(dependOn(x) ?: "") takeNotNull(dependOn(dependOn(x)) ?: "") takeNotNull(dependOn(dependOn(x) as? String) ?: "") - } + } - takeNotNull(bar()!!) + takeNotNull(bar()!!) } inline fun reifiedNull(): T? = null diff --git a/compiler/testData/diagnostics/tests/overload/defaultParameters.kt b/compiler/testData/diagnostics/tests/overload/defaultParameters.kt index a3ef5a4614c..da7c407b241 100644 --- a/compiler/testData/diagnostics/tests/overload/defaultParameters.kt +++ b/compiler/testData/diagnostics/tests/overload/defaultParameters.kt @@ -55,5 +55,5 @@ fun test() { withGenericDefaults("") - wrong(null!!) + wrong(null!!) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/visitor.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/visitor.kt index 9c59d23585f..4f31958b479 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/visitor.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/methodCall/visitor.kt @@ -21,5 +21,5 @@ public class Element { import p.* fun test(v: Visitor, e: Element) { - e.accept(v, null) + e.accept(v, null) } diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/noWarningOnDoubleElvis.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/noWarningOnDoubleElvis.kt index e9891546877..9bcde272cec 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/noWarningOnDoubleElvis.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/noWarningOnDoubleElvis.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER fun test() { - take(nullable() ?: nullable() ?: "foo") + take(nullable() ?: nullable() ?: "foo") } fun nullable(): T? = TODO() diff --git a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/cantBeInferred.kt b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/cantBeInferred.kt index 3e25e40f530..5f1c225af12 100644 --- a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/cantBeInferred.kt +++ b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/cantBeInferred.kt @@ -1,7 +1,7 @@ // !WITH_NEW_INFERENCE // 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/recursiveGetter.kt b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/recursiveGetter.kt index 632b8a87ad9..d8e0f16d48a 100644 --- a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/recursiveGetter.kt +++ b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/recursiveGetter.kt @@ -10,8 +10,8 @@ class A { val a get() = b 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 e653fa5441a..ef910e36490 100644 --- a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/unsupportedInferenceFromGetters.kt +++ b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/unsupportedInferenceFromGetters.kt @@ -8,8 +8,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!! diff --git a/compiler/testData/diagnostics/tests/regressions/correctResultSubstitutorForErrorCandidate.kt b/compiler/testData/diagnostics/tests/regressions/correctResultSubstitutorForErrorCandidate.kt index 8fa76806ef3..2860b1eac1f 100644 --- a/compiler/testData/diagnostics/tests/regressions/correctResultSubstitutorForErrorCandidate.kt +++ b/compiler/testData/diagnostics/tests/regressions/correctResultSubstitutorForErrorCandidate.kt @@ -2,7 +2,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/kt353.kt b/compiler/testData/diagnostics/tests/regressions/kt353.kt index 06ea7a09d8d..798ced14f08 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt353.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt353.kt @@ -7,18 +7,18 @@ interface A { fun foo(a: A) { val g : () -> Unit = { - a.gen() //it works: Unit is derived + a.gen() //it works: Unit is derived } 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 = { if (true) { - a.gen() // unit can be inferred + a.gen() // unit can be inferred } else { Unit @@ -29,5 +29,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/resolve/resolveWithFunctionLiteralWithId.kt b/compiler/testData/diagnostics/tests/resolve/resolveWithFunctionLiteralWithId.kt index 93a230cabef..6d2f361aedc 100644 --- a/compiler/testData/diagnostics/tests/resolve/resolveWithFunctionLiteralWithId.kt +++ b/compiler/testData/diagnostics/tests/resolve/resolveWithFunctionLiteralWithId.kt @@ -18,15 +18,15 @@ fun foo(i: Int, f: (Int)->Int) = f(i) fun id(t: T) = t fun test() { - foo(1, id { x1 -> - foo(2, id { x2 -> - foo(3, id { x3 -> - foo(4, id { x4 -> - foo(5, id { x5 -> - x1 + x2 + x3 + x4 + x5 + A.iii - }) - }) - }) - }) - }) + foo(1, id { x1 -> + foo(2, id { x2 -> + foo(3, id { x3 -> + foo(4, id { x4 -> + foo(5, id { x5 -> + x1 + x2 + x3 + x4 + x5 + A.iii + }) + }) + }) + }) + }) } diff --git a/compiler/testData/diagnostics/tests/resolve/resolveWithSpecifiedFunctionLiteralWithId.kt b/compiler/testData/diagnostics/tests/resolve/resolveWithSpecifiedFunctionLiteralWithId.kt index 626182c5195..67b4400b312 100644 --- a/compiler/testData/diagnostics/tests/resolve/resolveWithSpecifiedFunctionLiteralWithId.kt +++ b/compiler/testData/diagnostics/tests/resolve/resolveWithSpecifiedFunctionLiteralWithId.kt @@ -22,11 +22,11 @@ fun foo(i: Int, f: (Int) -> Int) = f(i) fun id(t: T) = t fun test() { - foo(1, id(fun(x1: Int) = - foo(2, id(fun(x2: Int) = - foo(3, id(fun(x3: Int) = - foo(4, id(fun(x4: Int) = - foo(5, id(fun(x5: Int) = + foo(1, id(fun(x1: Int) = + foo(2, id(fun(x2: Int) = + foo(3, id(fun(x3: Int) = + foo(4, id(fun(x4: Int) = + foo(5, id(fun(x5: Int) = x1 + x2 + x3 + x4 + x5 + A.iii )) )) diff --git a/compiler/testData/diagnostics/tests/smartCasts/lambdaAndArgument.kt b/compiler/testData/diagnostics/tests/smartCasts/lambdaAndArgument.kt index 5792a3f89a0..a13f12728c2 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/lambdaAndArgument.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/lambdaAndArgument.kt @@ -10,5 +10,5 @@ fun use() { // Write is AFTER x.hashCode() // x is nullable at the second argument - foo(bar { x = null }, x!!) + foo(bar { x = null }, x!!) } diff --git a/compiler/testData/diagnostics/tests/smartCasts/lambdaAndArgumentFun.kt b/compiler/testData/diagnostics/tests/smartCasts/lambdaAndArgumentFun.kt index 0cbe4c4629b..cc33f16a425 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/lambdaAndArgumentFun.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/lambdaAndArgumentFun.kt @@ -10,5 +10,5 @@ fun use() { // Write to x is AFTER x.hashCode() // No smart cast should be here! - foo(bar { x = null }, x.hashCode()) + foo(bar { x = null }, x.hashCode()) } diff --git a/compiler/testData/diagnostics/tests/typeParameters/implicitNothingAsTypeParameter.kt b/compiler/testData/diagnostics/tests/typeParameters/implicitNothingAsTypeParameter.kt index df1af2cd5ed..b7218ef65ff 100644 --- a/compiler/testData/diagnostics/tests/typeParameters/implicitNothingAsTypeParameter.kt +++ b/compiler/testData/diagnostics/tests/typeParameters/implicitNothingAsTypeParameter.kt @@ -11,13 +11,13 @@ fun case_1() { } fun case_2() { - test_1 { null!! } - test_2 { null!! } + test_1 { null!! } + test_2 { null!! } } fun case_3() { - test_1 { throw Exception() } - test_2 { throw Exception() } + test_1 { throw Exception() } + test_2 { throw Exception() } } fun case_6() { @@ -39,5 +39,5 @@ class Context fun Any.decodeIn(typeFrom: Context): T = something() fun Any?.decodeOut(typeFrom: Context): T { - return this?.decodeIn(typeFrom) ?: error("") + return this?.decodeIn(typeFrom) ?: error("") } diff --git a/compiler/testData/diagnostics/tests/when/kt9929.kt b/compiler/testData/diagnostics/tests/when/kt9929.kt index f1dc2682288..c94ac61f194 100644 --- a/compiler/testData/diagnostics/tests/when/kt9929.kt +++ b/compiler/testData/diagnostics/tests/when/kt9929.kt @@ -1,5 +1,5 @@ // !WITH_NEW_INFERENCE -val test: Int = if (true) { +val test: Int = if (true) { when (2) { 1 -> 1 else -> null diff --git a/compiler/testData/diagnostics/tests/when/kt9972.kt b/compiler/testData/diagnostics/tests/when/kt9972.kt index 814813cabeb..c2a485d038c 100644 --- a/compiler/testData/diagnostics/tests/when/kt9972.kt +++ b/compiler/testData/diagnostics/tests/when/kt9972.kt @@ -1,6 +1,6 @@ // !WITH_NEW_INFERENCE fun test1(): Int { - val x: String = if (true) { + val x: String = if (true) { when { true -> Any() else -> null @@ -10,7 +10,7 @@ fun test1(): Int { } fun test2(): Int { - val x: String = when { + val x: String = when { true -> Any() else -> null } ?: return 0