diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/instanceAccessBeforeSuperCall.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/instanceAccessBeforeSuperCall.kt index 3803e5b1085..637a3ec9786 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/instanceAccessBeforeSuperCall.kt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/instanceAccessBeforeSuperCall.kt @@ -7,10 +7,10 @@ class A { class B(other: B = this) class C() { - constructor(x: Int) : this({ + constructor(x: Int) : this({ val a = 10 this - }) {} + }) {} } class D { diff --git a/compiler/testData/diagnostics/tests/controlStructures/kt657.fir.kt b/compiler/testData/diagnostics/tests/controlStructures/kt657.fir.kt index eb6272ee5a2..779d04e5bbd 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/kt657.fir.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/kt657.fir.kt @@ -8,7 +8,7 @@ fun foo() = cond1() -> 12 cond2() -> 2 4 -> 34 - Pair(1, 2) -> 3 + Pair(1, 2) -> 3 in 1..10 -> 34 4 -> 38 is Int -> 33 diff --git a/compiler/testData/diagnostics/tests/declarationChecks/kClassInSignature.fir.kt b/compiler/testData/diagnostics/tests/declarationChecks/kClassInSignature.fir.kt index 77dc7958183..8ce920d8631 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/kClassInSignature.fir.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/kClassInSignature.fir.kt @@ -8,8 +8,8 @@ val test4 get() = T:: fun test5() = listOf(T::class) -fun test6(): kotlin.reflect.KClass = T::class -fun test7(): kotlin.reflect.KClass<*> = T::class +fun test6(): kotlin.reflect.KClass = T::class +fun test7(): kotlin.reflect.KClass<*> = T::class fun test8() = String?::class fun test9() where T : Any?, T : Comparable = T::class diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.fir.kt index ac1a73abcda..90cb338fe2e 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.fir.kt @@ -12,8 +12,8 @@ class A(outer: Outer) { 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 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/genericMethodInGenericClass.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethodInGenericClass.fir.kt index 95bb094e7ab..1d97b123f33 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethodInGenericClass.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethodInGenericClass.fir.kt @@ -25,4 +25,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/provideDelegate/unsupportedOperatorProvideDelegate.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/unsupportedOperatorProvideDelegate.fir.kt index 18936afb9d9..e4b9abf4c31 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/unsupportedOperatorProvideDelegate.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/unsupportedOperatorProvideDelegate.fir.kt @@ -10,6 +10,6 @@ operator fun String.provideDelegate(thisRef: Any?, prop: Any) = WrongDelegate(th operator fun String.getValue(thisRef: Any?, prop: Any) = this -val test1: String by "OK" +val test1: String by "OK" val test2: Int by "OK" val test3 by "OK" diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetReturnType.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetReturnType.fir.kt index 884b0ccfedb..c2ed3cf5369 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetReturnType.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetReturnType.fir.kt @@ -3,7 +3,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/functionLiterals/return/LocalReturnsWithExplicitReturnType.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnsWithExplicitReturnType.fir.kt index ac0c76d48db..91930abf1d3 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnsWithExplicitReturnType.fir.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnsWithExplicitReturnType.fir.kt @@ -1,10 +1,10 @@ // !WITH_NEW_INFERENCE fun test(a: Int) { runf@{ - if (a > 0) return@f "" + if (a > 0) return@f "" return@f 1 } - run{ "" } + run{ "" } run{ 1 } } diff --git a/compiler/testData/diagnostics/tests/generics/RecursiveUpperBoundCheck.fir.kt b/compiler/testData/diagnostics/tests/generics/RecursiveUpperBoundCheck.fir.kt index 49811563193..667fdbd573c 100644 --- a/compiler/testData/diagnostics/tests/generics/RecursiveUpperBoundCheck.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/RecursiveUpperBoundCheck.fir.kt @@ -1,3 +1,3 @@ open class C> class TestOK : C() -class TestFail : C>() +class TestFail : C>() diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/typeMismatchInLambda.fir.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/typeMismatchInLambda.fir.kt index 8e547cb5709..c1f1d9fa5c5 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/typeMismatchInLambda.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/typeMismatchInLambda.fir.kt @@ -14,14 +14,14 @@ class A { fun test(a: A, z: Out) { a.foo { val x: String = 1 // Should be no TYPE_MISMATCH_DUE_TO_TYPE_PROJECTIONS - "" + "" } - a.bar { Out() } + a.bar { Out() } a.bar { Out() } - a.bar { z.id() } + a.bar { z.id() } a.foo { - z.foobar(if (1 > 2) return@foo "" else "") - "" + z.foobar(if (1 > 2) return@foo "" else "") + "" } } diff --git a/compiler/testData/diagnostics/tests/inference/coercionToUnit/kt30242.fir.kt b/compiler/testData/diagnostics/tests/inference/coercionToUnit/kt30242.fir.kt index d93c8e8e792..3355d127606 100644 --- a/compiler/testData/diagnostics/tests/inference/coercionToUnit/kt30242.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/coercionToUnit/kt30242.fir.kt @@ -48,9 +48,9 @@ fun bar(block: () -> String) {} fun test_5(b: Boolean) { bar { - if (b) { + if (b) { println("meh") - } + } } } diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/cstFromNullableChildAndNonParameterizedType.fir.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/cstFromNullableChildAndNonParameterizedType.fir.kt index 5f8200ffa51..73eba954b72 100644 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/cstFromNullableChildAndNonParameterizedType.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/commonSystem/cstFromNullableChildAndNonParameterizedType.fir.kt @@ -16,5 +16,5 @@ fun test1(a: ParameterizedChild?, b: Child): Base = myRun { } fun test2(a: S?, b: S): S = myRun { - select(a, b) + select(a, b) } diff --git a/compiler/testData/diagnostics/tests/inference/completion/anonymousFunction.fir.kt b/compiler/testData/diagnostics/tests/inference/completion/anonymousFunction.fir.kt index 6eb49eb6ef7..c1442c34ddc 100644 --- a/compiler/testData/diagnostics/tests/inference/completion/anonymousFunction.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/completion/anonymousFunction.fir.kt @@ -20,5 +20,5 @@ fun testFunctions() { fun testNestedCalls() { id(inferFromLambda { materialize() }) id(inferFromLambda(fun() = materialize())) - id(inferFromLambda2(fun() = materialize())) + id(inferFromLambda2(fun() = materialize())) } diff --git a/compiler/testData/diagnostics/tests/inference/completion/kt33166.fir.kt b/compiler/testData/diagnostics/tests/inference/completion/kt33166.fir.kt index 257cfd0b79c..f69d42f0902 100644 --- a/compiler/testData/diagnostics/tests/inference/completion/kt33166.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/completion/kt33166.fir.kt @@ -31,7 +31,7 @@ fun f1(future: OurFuture, e: Either.Left) { true -> OurFuture.createOurFuture(e) else -> throw Exception() } - x + x } } @@ -42,4 +42,4 @@ fun f2(future: OurFuture, e: Either.Left) { else -> throw Exception() } } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/inference/completion/postponedArgumentsAnalysis/basic.fir.kt b/compiler/testData/diagnostics/tests/inference/completion/postponedArgumentsAnalysis/basic.fir.kt index 0c04617fb4b..2e08d507406 100644 --- a/compiler/testData/diagnostics/tests/inference/completion/postponedArgumentsAnalysis/basic.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/completion/postponedArgumentsAnalysis/basic.fir.kt @@ -78,11 +78,11 @@ fun main() { // Interdependent lambdas by input-output types aren't supported takeInterdependentLambdas({}, {}) - takeInterdependentLambdas({ it }, { 10 }) - takeInterdependentLambdas({ 10 }, { it }) - takeInterdependentLambdas({ 10 }, { x -> x }) - takeInterdependentLambdas({ x -> 10 }, { it }) - takeInterdependentLambdas({ it }, { x -> 10 }) + takeInterdependentLambdas({ it }, { 10 }) + takeInterdependentLambdas({ 10 }, { it }) + takeInterdependentLambdas({ 10 }, { x -> x }) + takeInterdependentLambdas({ x -> 10 }, { it }) + takeInterdependentLambdas({ it }, { x -> 10 }) // Dependent lambdas by input-output types takeDependentLambdas({ it }, { it }) @@ -138,8 +138,8 @@ fun main() { * K <: (C) -> Unit -> TypeVariable(_RP1) >: C * K == (B) -> Unit -> TypeVariable(_RP1) == B */ - val x17: (C) -> Unit = selectB(id { it }, id { it }, id<(B) -> Unit> { x -> x }) - val x18: (C) -> Unit = select(id { it }, { it }, id<(B) -> Unit> { x -> x }) + val x17: (C) -> Unit = selectB(id { it }, id { it }, id<(B) -> Unit> { x -> x }) + val x18: (C) -> Unit = select(id { it }, { it }, id<(B) -> Unit> { x -> x }) // Resolution of extension/non-extension functions combination val x19: String.() -> Unit = select(")!>id { this }, ")!>id(fun(x: String) {})) @@ -149,14 +149,14 @@ fun main() { select(")!>id(fun String.(x: String) {}), ")!>id(fun(x: String, y: String) {})) select(id(fun String.(x: String) {}), id(fun(x: String, y: String) { }), { x: String -> this }) select(id(fun String.(x: String) {}), id(fun(x: String, y: String) { }), { x -> this }) - select(id(fun String.(x: String) {}), id(fun(x: String, y: String) { }), { x: String, y: String -> x }) + select(id(fun String.(x: String) {}), id(fun(x: String, y: String) { }), { x: String, y: String -> x }) // Convert to extension lambda is impossible because the lambda parameter types aren't specified explicitly - select(id(fun String.(x: String) {}), id(fun(x: String, y: String) { }), { x, y -> x }) + select(id(fun String.(x: String) {}), id(fun(x: String, y: String) { }), { x, y -> x }) select(id(id(fun(x: String, y: String) { }), fun String.(x: String) {}), { x, y -> x }) val x26: Int.(String) -> Int = fun (x: String) = 10 // it must be error, see KT-38439 // Receiver must be specified in anonymous function declaration - val x27: Int.(String) -> Int = id(fun (x: String) = 10) - select(id Unit> {}, { x: Int, y: String -> x }) + val x27: Int.(String) -> Int = id(fun (x: String) = 10) + select(id Unit> {}, { x: Int, y: String -> x }) // Inferring lambda parameter types by partially specified parameter types of other lambdas select(id { x, y -> x.inv() + y.toByte() }, { x: Int, y -> y.toByte() }, { x, y: Number -> x.inv() }) @@ -218,7 +218,7 @@ fun main() { ")!>select({ x: Int -> TODO() }, id { x: Int, y: Number -> Any() }) ")!>select(id { x: Int -> null }, id { x: String -> "" }) ")!>select(id { x: Int -> 10 }, id { x: Int, y: Number -> TODO() }) - val x68: String.(String) -> String = select(id { x: String, y: String -> "10" }, id { x: String, y: String -> "TODO()" }) + val x68: String.(String) -> String = select(id { x: String, y: String -> "10" }, id { x: String, y: String -> "TODO()" }) // Anonymous functions val x69: (C) -> Unit = selectB({ it }, { }, id(fun (x) { x })) @@ -229,7 +229,7 @@ fun main() { val x71: String.() -> Unit = select(")!>id(fun String.() { }), ")!>id(fun(x: String) {})) val x72: String.() -> Unit = select(fun String.() { }, fun(x: String) {}) // must be error select(id(fun String.(x: String) {}), id(fun(x: String, y: String) { }), fun (x, y) { x;y }) - select(id Unit>(fun (x, y) {}), { x: Int, y: String -> x }) // receiver of anonymous function must be specified explicitly - select(id Unit>(fun Int.(y) {}), { x: Int, y: String -> x }) + select(id Unit>(fun (x, y) {}), { x: Int, y: String -> x }) // receiver of anonymous function must be specified explicitly + select(id Unit>(fun Int.(y) {}), { x: Int, y: String -> x }) ")!>select(A3(), fun (x) = "", { a -> a }) } diff --git a/compiler/testData/diagnostics/tests/inference/dependantOnVariance.fir.kt b/compiler/testData/diagnostics/tests/inference/dependantOnVariance.fir.kt index 1a332ce3272..eb6cfc9d313 100644 --- a/compiler/testData/diagnostics/tests/inference/dependantOnVariance.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/dependantOnVariance.fir.kt @@ -14,7 +14,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) diff --git a/compiler/testData/diagnostics/tests/inference/recursiveCalls/kt23531.fir.kt b/compiler/testData/diagnostics/tests/inference/recursiveCalls/kt23531.fir.kt index 8c06c32ec28..898993914ad 100644 --- a/compiler/testData/diagnostics/tests/inference/recursiveCalls/kt23531.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/recursiveCalls/kt23531.fir.kt @@ -13,7 +13,7 @@ fun insideJob1() = doTheJob1() suspend fun insideJob2() = doTheJob2() suspend fun insideJob3() = doTheJob3() -fun doTheJob0() = simpleAsync0 { insideJob0() } -fun doTheJob1() = simpleAsync1 { insideJob1() } -suspend fun doTheJob2() = simpleAsync2 { insideJob2() } -suspend fun doTheJob3() = simpleAsync3 { insideJob3() } +fun doTheJob0() = simpleAsync0 { insideJob0() } +fun doTheJob1() = simpleAsync1 { insideJob1() } +suspend fun doTheJob2() = simpleAsync2 { insideJob2() } +suspend fun doTheJob3() = simpleAsync3 { insideJob3() } diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2283.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2283.fir.kt index e64755422b2..227671a13fc 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2283.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2283.fir.kt @@ -10,5 +10,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.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2286.fir.kt index 9750fce3ffa..5fd5029ee29 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2286.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2286.fir.kt @@ -12,14 +12,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/kt731.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt731.fir.kt index 0c046e44916..eb259524968 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt731.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt731.fir.kt @@ -16,6 +16,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/typeInferenceExpectedTypeMismatch.fir.kt b/compiler/testData/diagnostics/tests/inference/typeInferenceExpectedTypeMismatch.fir.kt index b60ddfcd681..2c64137eb71 100644 --- a/compiler/testData/diagnostics/tests/inference/typeInferenceExpectedTypeMismatch.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/typeInferenceExpectedTypeMismatch.fir.kt @@ -4,7 +4,7 @@ package typeInferenceExpectedTypeMismatch import java.util.* fun test() { - val s : Set = newList() + val s : Set = newList() use(s) } @@ -26,7 +26,7 @@ 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) } diff --git a/compiler/testData/diagnostics/tests/j+k/sam/conversionForDerivedGenericClass.fir.kt b/compiler/testData/diagnostics/tests/j+k/sam/conversionForDerivedGenericClass.fir.kt index 38f84a1dd39..1626dac4fad 100644 --- a/compiler/testData/diagnostics/tests/j+k/sam/conversionForDerivedGenericClass.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/sam/conversionForDerivedGenericClass.fir.kt @@ -18,5 +18,5 @@ fun test(a: A, b: B, c: C) { b.f { } c.f { } C().f { } - C.g { } -} \ No newline at end of file + C.g { } +} diff --git a/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericInReturnType.fir.kt b/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericInReturnType.fir.kt index 0c79d1e27c3..8c4c5b28435 100644 --- a/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericInReturnType.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericInReturnType.fir.kt @@ -34,7 +34,7 @@ fun main() { } A.baz { - x -> x.hashCode() + x -> x.hashCode() } val block: (String) -> Any? = { diff --git a/compiler/testData/diagnostics/tests/modifiers/const/arrayInAnnotationArgumentType.fir.kt b/compiler/testData/diagnostics/tests/modifiers/const/arrayInAnnotationArgumentType.fir.kt index b0b57c817da..a708c8dc640 100644 --- a/compiler/testData/diagnostics/tests/modifiers/const/arrayInAnnotationArgumentType.fir.kt +++ b/compiler/testData/diagnostics/tests/modifiers/const/arrayInAnnotationArgumentType.fir.kt @@ -1,3 +1,3 @@ // !WITH_NEW_INFERENCE -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/nullableTypes/inferenceFlexibleTToNullable.fir.kt b/compiler/testData/diagnostics/tests/nullableTypes/inferenceFlexibleTToNullable.fir.kt index b535da389e5..5bd103abf79 100644 --- a/compiler/testData/diagnostics/tests/nullableTypes/inferenceFlexibleTToNullable.fir.kt +++ b/compiler/testData/diagnostics/tests/nullableTypes/inferenceFlexibleTToNullable.fir.kt @@ -32,12 +32,12 @@ public class Foo { // FILE: main.kt fun bar(n: Number?, d: T, e: T) { - val a: Number = Foo.simpleId(n) + val a: Number = Foo.simpleId(n) val b: Number? = Foo.simpleId(n) val c = Foo.simpleId(n) val x4 = Foo(if (true) 10 else null) - val x5: Number = x4.produceT() + val x5: Number = x4.produceT() val x6: Number? = x4.produceT() val x7 = x4.produceT() val x8 = x4.produceNotNullT() diff --git a/compiler/testData/diagnostics/tests/numbers/numbersInSimpleConstraints.fir.kt b/compiler/testData/diagnostics/tests/numbers/numbersInSimpleConstraints.fir.kt index e692fb60343..aa669f9dca7 100644 --- a/compiler/testData/diagnostics/tests/numbers/numbersInSimpleConstraints.fir.kt +++ b/compiler/testData/diagnostics/tests/numbers/numbersInSimpleConstraints.fir.kt @@ -17,9 +17,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) @@ -29,7 +29,7 @@ fun test() { val f: Byte = either(1, 2) - val g: Byte = either(1, 300) + val g: Byte = either(1, 300) other(11) diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/singleton.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/singleton.fir.kt index 96258980d2a..5cce6cae9c7 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/singleton.fir.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/methodCall/singleton.fir.kt @@ -5,6 +5,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/regressions/kt235.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt235.fir.kt index 5561051210f..1b36e923024 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt235.fir.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt235.fir.kt @@ -5,7 +5,7 @@ package kt235 fun main() { val array = MyArray() val f: () -> String = { - array[2] = 23 //error: Type mismatch: inferred type is Int (!!!) but String was expected + array[2] = 23 //error: Type mismatch: inferred type is Int (!!!) but String was expected } val g: () -> String = { var x = 1 @@ -17,11 +17,11 @@ fun main() { } val array1 = MyArray1() val i: () -> String = { - array1[2] = 23 + array1[2] = 23 } val fi: () -> String = { - array[2] = 23 + array[2] = 23 } val gi: () -> String = { var x = 1 @@ -46,4 +46,4 @@ class MyArray1() { class MyNumber() { operator fun inc(): MyNumber = MyNumber() -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/regressions/kt2768.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt2768.fir.kt deleted file mode 100644 index 0670f633eb2..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt2768.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -fun assertEquals(a: T, b: T) { - if (a != b) throw AssertionError("$a != $b") -} - -fun main() { - val bytePos = 128.toByte() // Byte.MAX_VALUE + 1 - assertEquals(-128, bytePos.toInt()) // correct, wrapped to Byte.MIN_VALUE - - val byteNeg: Byte = -bytePos // should not compile, byteNeg should be Int - assertEquals(128, byteNeg.toInt()) // passes, should not be possible - - val shortPos = 32768.toShort() // Short.MAX_VALUE + 1 - assertEquals(-32768, shortPos.toInt()) // correct, wrapped to Short.MIN_VALUE - - val shortNeg: Short = -shortPos // should not compile, shortNeg should be Int - assertEquals(32768, shortNeg.toInt()) // passes, should not be possible - - (-128).toByte() - -128.toByte() -} diff --git a/compiler/testData/diagnostics/tests/regressions/kt2768.kt b/compiler/testData/diagnostics/tests/regressions/kt2768.kt index afe608eadbe..7ce3503d1e4 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt2768.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt2768.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun assertEquals(a: T, b: T) { if (a != b) throw AssertionError("$a != $b") } diff --git a/compiler/testData/diagnostics/tests/regressions/kt32792.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt32792.fir.kt index 25f2174d30d..d426a562895 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt32792.fir.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt32792.fir.kt @@ -5,6 +5,6 @@ inline fun tryLambdas(lamb : () -> T) : T{ } fun main() { tryLambdas { - return@tryLambdas + return@tryLambdas } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/regressions/kt36222.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt36222.fir.kt deleted file mode 100644 index 1b411a21a07..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt36222.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER - -fun foo(f: () -> String) {} -fun select(x: K, y: K): K = x - -fun test() { - foo { select("non-null", null) } // inferred String? but String is expected -} - diff --git a/compiler/testData/diagnostics/tests/regressions/kt36222.kt b/compiler/testData/diagnostics/tests/regressions/kt36222.kt index e62d0c00d6d..dd3c5873254 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt36222.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt36222.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/constructorCallType.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/constructorCallType.fir.kt index 758a84a4c91..07592296bd7 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/constructorCallType.fir.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/constructorCallType.fir.kt @@ -21,7 +21,7 @@ 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) diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/return.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/return.fir.kt index 86490c6c3da..0e9f792a643 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/return.fir.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/return.fir.kt @@ -10,7 +10,7 @@ class A { return 1 } return - return foo() + return foo() } fun foo(): Int = 1 diff --git a/compiler/testData/diagnostics/tests/typeParameters/kt42396.fir.kt b/compiler/testData/diagnostics/tests/typeParameters/kt42396.fir.kt index 946fe50c23f..8a983a107bc 100644 --- a/compiler/testData/diagnostics/tests/typeParameters/kt42396.fir.kt +++ b/compiler/testData/diagnostics/tests/typeParameters/kt42396.fir.kt @@ -12,6 +12,6 @@ fun wrapAAndBToOut(x: F): Out where F : A, F : B = Out() fun main(a: A) { val x: Out = materializeOutOfAAndB() // OI: inferred type A is not a subtype of B; `F` is instantiated as `A`, so upper bounds was violated - val y: Inv = materializeInvOfAAndB() // OI and NI: required B, found A + val y: Inv = materializeInvOfAAndB() // OI and NI: required B, found A val z: Out = wrapAAndBToOut(a) // OI and NI: required B, found A -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/typealias/inheritedNestedTypeAlias.fir.kt b/compiler/testData/diagnostics/tests/typealias/inheritedNestedTypeAlias.fir.kt index 1f9518bf269..4ce55439986 100644 --- a/compiler/testData/diagnostics/tests/typealias/inheritedNestedTypeAlias.fir.kt +++ b/compiler/testData/diagnostics/tests/typealias/inheritedNestedTypeAlias.fir.kt @@ -16,5 +16,5 @@ class Derived : Base() { val x2: Base.InnerCell = InnerCell(42) val test1: CT = Cell(42) - val test2: Base.CT = Cell(42) + val test2: Base.CT = Cell(42) } diff --git a/compiler/testData/diagnostics/tests/when/NoElseReturnedFromLambdaExpectedInt.fir.kt b/compiler/testData/diagnostics/tests/when/NoElseReturnedFromLambdaExpectedInt.fir.kt index 3a452e87291..4c6d889bb37 100644 --- a/compiler/testData/diagnostics/tests/when/NoElseReturnedFromLambdaExpectedInt.fir.kt +++ b/compiler/testData/diagnostics/tests/when/NoElseReturnedFromLambdaExpectedInt.fir.kt @@ -11,9 +11,9 @@ fun foo(x: Int) { r { - when (x) { + when (x) { 2 -> 0 - } + } } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41164.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41164.fir.kt index b4bf46cb122..7acf8f857a6 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41164.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41164.fir.kt @@ -16,10 +16,10 @@ fun MyProducerScope<*>.myAwaitClose(block: () -> Unit = {}) {} fun myEmptyFlow(): MyFlow = null!! fun test(): MyFlow { - return select( + return select( ")!>myCallbackFlow , kotlin.Unit>")!>{ myAwaitClose {} }, myEmptyFlow() - ) + ) } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/plusAssignWithLambda.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/plusAssignWithLambda.fir.kt index af677bc41dd..529617892f0 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/plusAssignWithLambda.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/plusAssignWithLambda.fir.kt @@ -26,7 +26,7 @@ fun id(x: T) = x fun foo2() = { var x = A() - x += { "" } + x += { "" } var y = A() y += 1 } @@ -37,6 +37,6 @@ class B { } fun foo3(x: B) = { - x += { "" } - x += id { "" } + x += { "" } + x += id { "" } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/lambdaExpectedType.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/lambdaExpectedType.fir.kt index e45e7c3aa02..ac8d2179daf 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/lambdaExpectedType.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/lambdaExpectedType.fir.kt @@ -29,7 +29,7 @@ fun foo() { i = genericBuilder { 1 } genericBuilder { 1 } genericBuilder { 1 } - genericBuilder { "" } + genericBuilder { "" } val y = { 1 } genericBuilder(y) @@ -44,7 +44,7 @@ fun foo() { val s: String = manyArgumentsBuilder({}, { "" }) { 1 } manyArgumentsBuilder({}, { "" }, { 1 }) - manyArgumentsBuilder({}, { 1 }, { 2 }) + manyArgumentsBuilder({}, { 1 }, { 2 }) severalParamsInLambda { x, y -> x checkType { _() } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/tryCatchLambda.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/tryCatchLambda.fir.kt index 6a3ede0ecb6..12d21d39945 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/tryCatchLambda.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/tryCatchLambda.fir.kt @@ -8,10 +8,10 @@ fun genericBuilder(c: suspend () -> T): T = null!! fun foo() { var result = "" genericBuilder { - try { + try { await("") } catch(e: Exception) { result = "fail" - } + } } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/factoryPattern/overloadByLambdaReturnType_disabled.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/factoryPattern/overloadByLambdaReturnType_disabled.fir.kt index c24133ec13b..74096807f9b 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/factoryPattern/overloadByLambdaReturnType_disabled.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/factoryPattern/overloadByLambdaReturnType_disabled.fir.kt @@ -30,7 +30,7 @@ fun test_2() { } fun test_3() { - val x = create { 1.0 } + val x = create { 1.0 } } @OverloadResolutionByLambdaReturnType diff --git a/compiler/testData/diagnostics/testsWithStdLib/factoryPattern/overloadByLambdaReturnType_enabled.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/factoryPattern/overloadByLambdaReturnType_enabled.fir.kt index 1113a848f54..ee2eeda2748 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/factoryPattern/overloadByLambdaReturnType_enabled.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/factoryPattern/overloadByLambdaReturnType_enabled.fir.kt @@ -30,7 +30,7 @@ fun test_2() { } fun test_3() { - val x = create { 1.0 } + val x = create { 1.0 } } @OverloadResolutionByLambdaReturnType diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/exactAnnotation.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/exactAnnotation.fir.kt index ea3d533660e..351ea75d8fc 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/exactAnnotation.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/exactAnnotation.fir.kt @@ -8,5 +8,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/resolve/kt4711.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/kt4711.fir.kt index 3c7c16d90e8..e373b910122 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/kt4711.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/kt4711.fir.kt @@ -10,7 +10,7 @@ fun main() { 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 diff --git a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/tryExpression.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/tryExpression.fir.kt index 40b7f8ad40c..1c38015fdf9 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/tryExpression.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/tryExpression.fir.kt @@ -27,9 +27,9 @@ fun test1(): Map = run { } fun test2(): Map = run { - try { + try { emptyMap() } catch (e: ExcA) { mapOf("" to "") - } + } } diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/p-6/neg/1.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/p-6/neg/1.1.fir.kt index 4327b3e006e..541e96bbd41 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/p-6/neg/1.1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/p-6/neg/1.1.fir.kt @@ -53,8 +53,8 @@ public class JavaClassCase3{ // TESTCASE NUMBER: 3 fun case3() { val x = JavaClassCase3.id(null) // Nothing! - x - val a = if (x) { + x + val a = if (x) { "NOK" } else "NOK" } diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-2/neg/2.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-2/neg/2.1.fir.kt index abf479e0504..36d510000d8 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-2/neg/2.1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-2/neg/2.1.fir.kt @@ -3,12 +3,12 @@ // TESTCASE NUMBER: 1 fun case_1(value_1: Int, value_2: String, value_3: TypesProvider): String { when { - .012f / value_1 -> return "" + .012f / value_1 -> return "" "$value_2..." -> return "" '-' -> return "" {} -> return "" - value_3.getAny() -> return "" - -10..-1 -> return "" + value_3.getAny() -> return "" + -10..-1 -> return "" } return "" diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-2/neg/2.2.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-2/neg/2.2.fir.kt index b6bd26175ab..ee8b9b50ac4 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-2/neg/2.2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-2/neg/2.2.fir.kt @@ -5,7 +5,7 @@ fun case_1(value_1: TypesProvider) { when { getBoolean(), value_1.getBoolean() -> return value_1.getBoolean() && getBoolean(), getLong() == 1000L -> return - Out(), getLong(), {}, Any(), throw Exception() -> return + Out(), getLong(), {}, Any(), throw Exception() -> return } return diff --git a/idea/testData/checker/Bounds.fir.kt b/idea/testData/checker/Bounds.fir.kt index ab196ced66b..1ac222a40b9 100644 --- a/idea/testData/checker/Bounds.fir.kt +++ b/idea/testData/checker/Bounds.fir.kt @@ -3,7 +3,7 @@ class Pair - abstract class C, X : (B) -> Pair, B>>() : B() { // 2 errors + abstract class C, X : (B) -> Pair, B>>() : B() { // 2 errors val a = B<Char>() // error abstract val x : (B) -> B diff --git a/idea/testData/checker/BoundsWithSubstitutors.fir.kt b/idea/testData/checker/BoundsWithSubstitutors.fir.kt index d28a7c3fae2..0b219846797 100644 --- a/idea/testData/checker/BoundsWithSubstitutors.fir.kt +++ b/idea/testData/checker/BoundsWithSubstitutors.fir.kt @@ -6,7 +6,7 @@ class C : A() val a = B() - val a1 = B<Int>() + val a1 = B<Int>() class X() diff --git a/idea/testData/checker/MultipleBounds.fir.kt b/idea/testData/checker/MultipleBounds.fir.kt index cfca76480f3..5ecd4981bac 100644 --- a/idea/testData/checker/MultipleBounds.fir.kt +++ b/idea/testData/checker/MultipleBounds.fir.kt @@ -30,8 +30,8 @@ class Test1() } fun test() { - Test1<B>() - Test1<A>() + Test1<B>() + Test1<A>() Test1() } diff --git a/idea/testData/checker/regression/kt303.fir.kt b/idea/testData/checker/regression/kt303.fir.kt index ac3cc5182cf..a7b98983f99 100644 --- a/idea/testData/checker/regression/kt303.fir.kt +++ b/idea/testData/checker/regression/kt303.fir.kt @@ -8,4 +8,4 @@ open class Bar() : FooFoo() +val x : Int = Foo()