diff --git a/compiler/testData/diagnostics/tests/AutoCreatedIt.kt b/compiler/testData/diagnostics/tests/AutoCreatedIt.kt index b08fa55122f..122e19df15f 100644 --- a/compiler/testData/diagnostics/tests/AutoCreatedIt.kt +++ b/compiler/testData/diagnostics/tests/AutoCreatedIt.kt @@ -3,8 +3,8 @@ 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} @@ -13,7 +13,7 @@ fun text() { bar2 {} bar2 {1} bar2 {it} - bar2 {it -> it} + bar2 {it -> it} } fun bar(f : (Int, Int) -> Int) {} diff --git a/compiler/testData/diagnostics/tests/Basic.kt b/compiler/testData/diagnostics/tests/Basic.kt index 97cab674d1a..9f860c46855 100644 --- a/compiler/testData/diagnostics/tests/Basic.kt +++ b/compiler/testData/diagnostics/tests/Basic.kt @@ -10,7 +10,7 @@ fun test() : Int { } class A() { - val x : Int = foo1(xx) + val x : Int = foo1(xx) } fun foo1() {} diff --git a/compiler/testData/diagnostics/tests/BinaryCallsOnNullableValues.kt b/compiler/testData/diagnostics/tests/BinaryCallsOnNullableValues.kt index f52b511ab4c..ca348d66eef 100644 --- a/compiler/testData/diagnostics/tests/BinaryCallsOnNullableValues.kt +++ b/compiler/testData/diagnostics/tests/BinaryCallsOnNullableValues.kt @@ -6,10 +6,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 @@ -22,11 +22,11 @@ fun f(): Unit { x === 1 x !== 1 - x..2 + x..2 x in 1..2 val y : Boolean? = true - false || y - y && true - y && 1 + false || y + y && true + y && 1 } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/Bounds.kt b/compiler/testData/diagnostics/tests/Bounds.kt index d91a22dc5c3..f74e9db347a 100644 --- a/compiler/testData/diagnostics/tests/Bounds.kt +++ b/compiler/testData/diagnostics/tests/Bounds.kt @@ -7,12 +7,12 @@ package boundsWithSubstitutors class C : A() val a = B() - val a1 = B<Int>() + val a1 = B<Int>() class X() val b = X, C>>() - val b0 = XAny?>() + val b0 = XAny?>() val b1 = X, String>>() // FILE: b.kt diff --git a/compiler/testData/diagnostics/tests/CompareToWithErrorType.kt b/compiler/testData/diagnostics/tests/CompareToWithErrorType.kt index fffe1dd919d..f9620dae68d 100644 --- a/compiler/testData/diagnostics/tests/CompareToWithErrorType.kt +++ b/compiler/testData/diagnostics/tests/CompareToWithErrorType.kt @@ -1,6 +1,6 @@ // !WITH_NEW_INFERENCE fun test() { - if (x > 0) { + if (x > 0) { } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/DefaultValuesTypechecking.kt b/compiler/testData/diagnostics/tests/DefaultValuesTypechecking.kt index 1d53a3591c7..e2e2c7cc335 100644 --- a/compiler/testData/diagnostics/tests/DefaultValuesTypechecking.kt +++ b/compiler/testData/diagnostics/tests/DefaultValuesTypechecking.kt @@ -1,14 +1,14 @@ // !WITH_NEW_INFERENCE val x = "" -fun bar(x : Int = "", y : Int = x, z : String = y) { +fun bar(x : Int = "", y : Int = x, z : String = y) { } // KT-371 Resolve default parameters for constructors class A(x : Int = y, y : Int = x) { // None of the references is resolved, no types checked - fun foo(bool: Boolean, a: Int = b, b: String = a) {} + fun foo(bool: Boolean, a: Int = b, b: String = a) {} } val z = 3 diff --git a/compiler/testData/diagnostics/tests/DeprecatedUnaryOperatorConventions.kt b/compiler/testData/diagnostics/tests/DeprecatedUnaryOperatorConventions.kt index c39ee97049a..c979d34fa4c 100644 --- a/compiler/testData/diagnostics/tests/DeprecatedUnaryOperatorConventions.kt +++ b/compiler/testData/diagnostics/tests/DeprecatedUnaryOperatorConventions.kt @@ -16,7 +16,7 @@ operator fun String.unaryPlus(): Int = 0 fun test() { requireInt(+ "") requireInt(+ Example()) - requireString(+ ExampleDeprecated()) + requireString(+ ExampleDeprecated()) } fun requireInt(n: Int) {} @@ -27,7 +27,7 @@ class Example2 { operator fun minus() = this fun test() { - +this + +this -this } } diff --git a/compiler/testData/diagnostics/tests/EnumEntryAsType.kt b/compiler/testData/diagnostics/tests/EnumEntryAsType.kt index ff475d00452..383a58c73ec 100644 --- a/compiler/testData/diagnostics/tests/EnumEntryAsType.kt +++ b/compiler/testData/diagnostics/tests/EnumEntryAsType.kt @@ -9,7 +9,7 @@ enum class Color { class MyColor(val x: Color.RED, y: Color.RED) : Color.RED { - var z: Color.RED = Color.RED + var z: Color.RED = Color.RED set(arg: Color.RED) { z = arg } fun foo(arg: Color.RED): Color.RED = arg @@ -17,7 +17,7 @@ class MyColor(val x: Color.RED, y: Color.RED { class Local : Color.RED fun local(arg: Color.RED): Color.RED = arg - val temp: Color.RED = Color.RED + val temp: Color.RED = Color.RED temp as? Color.RED if (temp is Color.RED) { return temp as Color.RED @@ -26,7 +26,7 @@ class MyColor(val x: Color.RED, y: Color.obj is Color.RED) { return obj } - return Color.RED + return Color.RED } } diff --git a/compiler/testData/diagnostics/tests/FunctionCalleeExpressions.kt b/compiler/testData/diagnostics/tests/FunctionCalleeExpressions.kt index e48130247c2..d2fb5511921 100644 --- a/compiler/testData/diagnostics/tests/FunctionCalleeExpressions.kt +++ b/compiler/testData/diagnostics/tests/FunctionCalleeExpressions.kt @@ -26,13 +26,13 @@ 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(){} @@ -45,7 +45,7 @@ fun main(args : Array) { val b = fooT2()(1) checkSubtype(b) - fooT2()(1) // : Any? + fooT2()(1) // : Any? 1() 1{} diff --git a/compiler/testData/diagnostics/tests/FunctionReturnTypes.kt b/compiler/testData/diagnostics/tests/FunctionReturnTypes.kt index 55e33e962af..553ac467aff 100644 --- a/compiler/testData/diagnostics/tests/FunctionReturnTypes.kt +++ b/compiler/testData/diagnostics/tests/FunctionReturnTypes.kt @@ -45,7 +45,7 @@ fun intFunctionLiteral(): Int = { 1 fun blockReturnUnitMismatch() : Int {return} fun blockReturnValueTypeMismatch() : Int {return 3.4} fun blockReturnValueTypeMatch() : Int {return 1} -fun blockReturnValueTypeMismatchUnit() : Int {return Unit} +fun blockReturnValueTypeMismatchUnit() : Int {return Unit} fun blockAndAndMismatch() : Int { true && false @@ -67,7 +67,7 @@ fun blockAndAndMismatch5() : Int { (return true) || (return false) } fun blockReturnValueTypeMatch1() : Int { - return if (1 > 2) 1.0 else 2.0 + return if (1 > 2) 1.0 else 2.0 } fun blockReturnValueTypeMatch2() : Int { return if (1 > 2) 1 @@ -134,7 +134,7 @@ fun blockNoReturnIfUnitInOneBranch(): Int { } } } -fun nonBlockReturnIfEmptyIf(): Int = if (1 < 2) {} else {} +fun nonBlockReturnIfEmptyIf(): Int = if (1 < 2) {} else {} fun nonBlockNoReturnIfUnitInOneBranch(): Int = if (1 < 2) {} else 2 val a = return 1 @@ -146,14 +146,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 fcc15827204..ec0c1c2124d 100644 --- a/compiler/testData/diagnostics/tests/InvokeAndRecursiveResolve.kt +++ b/compiler/testData/diagnostics/tests/InvokeAndRecursiveResolve.kt @@ -13,5 +13,5 @@ class B { class C { val bar = test() - val test = bar() + val test = bar() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/Nullability.kt b/compiler/testData/diagnostics/tests/Nullability.kt index 63fc4f189b3..a7599f3cd27 100644 --- a/compiler/testData/diagnostics/tests/Nullability.kt +++ b/compiler/testData/diagnostics/tests/Nullability.kt @@ -147,7 +147,7 @@ fun test() { while (out2 == null) { out2?.println(); - out2.println(); + out2.println(); } out2.println() diff --git a/compiler/testData/diagnostics/tests/PackageInExpressionPosition.kt b/compiler/testData/diagnostics/tests/PackageInExpressionPosition.kt index fe2e2ca4e0c..74fb7939f7e 100644 --- a/compiler/testData/diagnostics/tests/PackageInExpressionPosition.kt +++ b/compiler/testData/diagnostics/tests/PackageInExpressionPosition.kt @@ -23,5 +23,5 @@ fun main(args : Array) { System() (System) foo@ System - null in System + null in System } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/PackageQualified.kt b/compiler/testData/diagnostics/tests/PackageQualified.kt index a0f38399b6b..f37ddce8df4 100644 --- a/compiler/testData/diagnostics/tests/PackageQualified.kt +++ b/compiler/testData/diagnostics/tests/PackageQualified.kt @@ -20,7 +20,7 @@ abstract class Foo() { package foobar.a import java.util.* - val b : List? = a + val b : List? = a val b1 : util.List? = a // FILE: b.kt diff --git a/compiler/testData/diagnostics/tests/Properties.kt b/compiler/testData/diagnostics/tests/Properties.kt index 0da9f1cc61b..d954f011eef 100644 --- a/compiler/testData/diagnostics/tests/Properties.kt +++ b/compiler/testData/diagnostics/tests/Properties.kt @@ -1,8 +1,10 @@ +// !WITH_NEW_INFERENCE + var x : Int = 1 + x get() : Int = 1 set(value : Long) { field = value.toInt() - field = 1.toLong() + field = 1.toLong() } val xx : Int = 1 + x diff --git a/compiler/testData/diagnostics/tests/QualifiedExpressions.kt b/compiler/testData/diagnostics/tests/QualifiedExpressions.kt index 8f213c1601a..5921611129a 100644 --- a/compiler/testData/diagnostics/tests/QualifiedExpressions.kt +++ b/compiler/testData/diagnostics/tests/QualifiedExpressions.kt @@ -5,8 +5,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 33f11d4dd12..a14f9dde4d2 100644 --- a/compiler/testData/diagnostics/tests/RecursiveTypeInference.kt +++ b/compiler/testData/diagnostics/tests/RecursiveTypeInference.kt @@ -3,19 +3,19 @@ package a val foo = bar() - fun bar() = foo + fun bar() = foo // FILE: f.kt package b fun foo() = bar() - fun bar() = foo() + fun bar() = foo() // FILE: f.kt package c fun bazz() = bar() - fun foo() = bazz() + fun foo() = bazz() fun bar() = foo() diff --git a/compiler/testData/diagnostics/tests/ReserveYield.kt b/compiler/testData/diagnostics/tests/ReserveYield.kt index bd7d8aa8bed..42d30817ddf 100644 --- a/compiler/testData/diagnostics/tests/ReserveYield.kt +++ b/compiler/testData/diagnostics/tests/ReserveYield.kt @@ -20,7 +20,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 2cfa9bdbbb5..eaae15e42e0 100644 --- a/compiler/testData/diagnostics/tests/ResolveOfJavaGenerics.kt +++ b/compiler/testData/diagnostics/tests/ResolveOfJavaGenerics.kt @@ -5,7 +5,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 0410c82411a..aff18e7a3e7 100644 --- a/compiler/testData/diagnostics/tests/ResolveToJava.kt +++ b/compiler/testData/diagnostics/tests/ResolveToJava.kt @@ -20,10 +20,10 @@ fun test(l : java.util 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/SafeCallInvoke.kt b/compiler/testData/diagnostics/tests/SafeCallInvoke.kt index 355a8ec4d2a..1aaeaffe446 100644 --- a/compiler/testData/diagnostics/tests/SafeCallInvoke.kt +++ b/compiler/testData/diagnostics/tests/SafeCallInvoke.kt @@ -14,7 +14,7 @@ fun foo() { rule?.apply?.invoke() // this should be an error - rule?.apply() + rule?.apply() // these both also ok (with smart cast / unnecessary safe call) if (rule != null) { diff --git a/compiler/testData/diagnostics/tests/SafeCallNonNullReceiverReturnNull.kt b/compiler/testData/diagnostics/tests/SafeCallNonNullReceiverReturnNull.kt index eccc9ecef1c..44d3feb0d78 100644 --- a/compiler/testData/diagnostics/tests/SafeCallNonNullReceiverReturnNull.kt +++ b/compiler/testData/diagnostics/tests/SafeCallNonNullReceiverReturnNull.kt @@ -3,5 +3,5 @@ fun Int.gg() = null fun ff() { val a: Int = 1 - val b: Int = a?.gg() + val b: Int = a?.gg() } diff --git a/compiler/testData/diagnostics/tests/TypeInference.kt b/compiler/testData/diagnostics/tests/TypeInference.kt index e96ab9b2d98..f32d0200af4 100644 --- a/compiler/testData/diagnostics/tests/TypeInference.kt +++ b/compiler/testData/diagnostics/tests/TypeInference.kt @@ -10,10 +10,10 @@ fun main(args : Array) { 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() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/Variance.kt b/compiler/testData/diagnostics/tests/Variance.kt index 4de5b052a5d..6af79f87cb3 100644 --- a/compiler/testData/diagnostics/tests/Variance.kt +++ b/compiler/testData/diagnostics/tests/Variance.kt @@ -8,14 +8,14 @@ abstract class Producer {} abstract class Usual {} fun foo(c: Consumer, p: Producer, u: Usual) { - val c1: Consumer = c + val c1: Consumer = c val c2: Consumer = c1 val p1: Producer = p - val p2: Producer = p1 + val p2: Producer = p1 - val u1: Usual = u - val u2: Usual = u1 + val u1: Usual = u + val u2: Usual = u1 } //Arrays copy example diff --git a/compiler/testData/diagnostics/tests/annotations/AmbigiousAnnotationConstructor.kt b/compiler/testData/diagnostics/tests/annotations/AmbigiousAnnotationConstructor.kt index d59acb87d36..944a8b14437 100644 --- a/compiler/testData/diagnostics/tests/annotations/AmbigiousAnnotationConstructor.kt +++ b/compiler/testData/diagnostics/tests/annotations/AmbigiousAnnotationConstructor.kt @@ -1,6 +1,6 @@ // !WITH_NEW_INFERENCE import java.util.ArrayList -@ArrayList(1, 1) fun b() {} +@ArrayList(1, 1) fun b() {} @Xoo(x) fun c() {} @java.lang.Deprecated(x) fun a() {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/kt1860-negative.kt b/compiler/testData/diagnostics/tests/annotations/kt1860-negative.kt index f329a08dd2f..9dcdb9e9121 100644 --- a/compiler/testData/diagnostics/tests/annotations/kt1860-negative.kt +++ b/compiler/testData/diagnostics/tests/annotations/kt1860-negative.kt @@ -4,7 +4,7 @@ fun foo(@varargs f : Int) {} var bar : Int = 1 set(@varargs v) {} -val x : (Int) -> Int = {@varargs x : Int -> x} +val x : (Int) -> Int = {@varargs x : Int -> x} class Hello(@varargs args: Any) { } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/kt1860-positive.kt b/compiler/testData/diagnostics/tests/annotations/kt1860-positive.kt index c7fa0c571ee..3f6e31bbe81 100644 --- a/compiler/testData/diagnostics/tests/annotations/kt1860-positive.kt +++ b/compiler/testData/diagnostics/tests/annotations/kt1860-positive.kt @@ -7,7 +7,7 @@ fun foo(@test f : Int) {} var bar : Int = 1 set(@test v) {} -val x : (Int) -> Int = {@test x : Int -> x} // todo fix parser annotation on lambda parameter +val x : (Int) -> Int = {@test x : Int -> x} // todo fix parser annotation on lambda parameter class Hello(@test args: Any) { } diff --git a/compiler/testData/diagnostics/tests/annotations/options/functions.kt b/compiler/testData/diagnostics/tests/annotations/options/functions.kt index 39f0b1c5507..902aca5dde4 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) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/field.kt b/compiler/testData/diagnostics/tests/annotations/options/targets/field.kt index f7ad5897fce..9b99cab215d 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/field.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/field.kt @@ -28,7 +28,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/callableReference/bound/reservedExpressionSyntax3.kt b/compiler/testData/diagnostics/tests/callableReference/bound/reservedExpressionSyntax3.kt index f070ce5c77c..4cb8f15091a 100644 --- a/compiler/testData/diagnostics/tests/callableReference/bound/reservedExpressionSyntax3.kt +++ b/compiler/testData/diagnostics/tests/callableReference/bound/reservedExpressionSyntax3.kt @@ -23,7 +23,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 } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/function/extensionToSupertype.kt b/compiler/testData/diagnostics/tests/callableReference/function/extensionToSupertype.kt index 4f27d448e65..545511d6d28 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/extensionToSupertype.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/extensionToSupertype.kt @@ -15,5 +15,5 @@ fun take(f: () -> Unit) {} fun test() { B::foo checkType { _>() } - take(B::foo) + take(B::foo) } diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/argumentAndReturnExpectedType.kt b/compiler/testData/diagnostics/tests/callableReference/generic/argumentAndReturnExpectedType.kt index 1fc3491945e..480bac1c3df 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/argumentAndReturnExpectedType.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/argumentAndReturnExpectedType.kt @@ -16,9 +16,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 2a8773369a4..115cc5b6903 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/explicitTypeArguments.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/explicitTypeArguments.kt @@ -14,12 +14,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 406a00ab6c0..1dec1c9ca97 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/genericExtensionFunction.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/genericExtensionFunction.kt @@ -23,8 +23,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 7598300d812..f291e692e14 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/genericFunctionsWithNullableTypes.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/genericFunctionsWithNullableTypes.kt @@ -29,9 +29,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 (a1: Int, b1: String) = bar(1, "", ::foo) + val s5: Pair = bar(1, "", ::foo) + val (a1: Int, b1: String) = bar(1, "", ::foo) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/nestedCallWithOverload.kt b/compiler/testData/diagnostics/tests/callableReference/generic/nestedCallWithOverload.kt index 2cddf1299a6..776bf38aabd 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/nestedCallWithOverload.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/nestedCallWithOverload.kt @@ -11,7 +11,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 03bf4f4a467..8b586533db6 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/resolutionGenericCallableWithNullableTypes.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/resolutionGenericCallableWithNullableTypes.kt @@ -17,7 +17,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) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/resolutionWithGenericCallable.kt b/compiler/testData/diagnostics/tests/callableReference/generic/resolutionWithGenericCallable.kt index 74ebc672413..c3ef709da74 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/resolutionWithGenericCallable.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/resolutionWithGenericCallable.kt @@ -5,9 +5,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) {} @@ -18,5 +18,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/generic/specialCalls.kt b/compiler/testData/diagnostics/tests/callableReference/generic/specialCalls.kt index cf174a5413b..7427ec827bf 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/specialCalls.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/specialCalls.kt @@ -9,7 +9,7 @@ fun nullableFun(): ((Int) -> Int)? = null fun test() { val x1: (Int) -> Int = bar(if (true) ::baz else ::baz) val x2: (Int) -> Int = bar(nullableFun() ?: ::baz) - val x3: (Int) -> Int = bar(::baz ?: ::baz) + val x3: (Int) -> Int = bar(::baz ?: ::baz) val i = 0 val x4: (Int) -> Int = bar(when (i) { diff --git a/compiler/testData/diagnostics/tests/callableReference/property/kt7945_unrelatedClass.kt b/compiler/testData/diagnostics/tests/callableReference/property/kt7945_unrelatedClass.kt index 26f2448ab03..b12987cf8bb 100644 --- a/compiler/testData/diagnostics/tests/callableReference/property/kt7945_unrelatedClass.kt +++ b/compiler/testData/diagnostics/tests/callableReference/property/kt7945_unrelatedClass.kt @@ -7,5 +7,5 @@ class TestClass(var prop: Int) open class OtherClass fun OtherClass.test(prop: KProperty1): Unit = throw Exception() class OtherClass2: OtherClass() { - val result = test(TestClass::result) + val result = test(TestClass::result) } diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/byGenericArgType.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/byGenericArgType.kt index aa9226db750..450d7073b88 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/byGenericArgType.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/byGenericArgType.kt @@ -8,4 +8,4 @@ fun foo(s: String) {} val x1 = ofType<() -> Unit>(::foo) val x2 = ofType<(String) -> Unit>(::foo) -val x3 = ofType<(Int) -> Unit>(::foo) \ No newline at end of file +val x3 = ofType<(Int) -> Unit>(::foo) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/intersectionTypeOverloadWithWrongParameter.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/intersectionTypeOverloadWithWrongParameter.kt index a3d0c988b43..e6bb894c11b 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/intersectionTypeOverloadWithWrongParameter.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/intersectionTypeOverloadWithWrongParameter.kt @@ -11,7 +11,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 33279803ac6..693953125b9 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) \ No newline at end of file +val x3 = apply(true, ::foo) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/withPlaceholderTypes.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/withPlaceholderTypes.kt index 36c4d95792e..831f3a9652d 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/withPlaceholderTypes.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/withPlaceholderTypes.kt @@ -20,8 +20,8 @@ fun fn3(i: Int, f: (Int, Int, Int) -> Int): Int = f(i, i, i) 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 x3 = fn2(::bar, ::foo) +val x4 = fn2(::foo, ::bar) +val x5 = fn2(::foo, ::foo) val x6 = fn3(1, ::qux) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/cast/AsInBinaryUnary.kt b/compiler/testData/diagnostics/tests/cast/AsInBinaryUnary.kt index e99f82e46bd..433edcaa998 100644 --- a/compiler/testData/diagnostics/tests/cast/AsInBinaryUnary.kt +++ b/compiler/testData/diagnostics/tests/cast/AsInBinaryUnary.kt @@ -20,11 +20,11 @@ operator fun Impl2.unaryMinus() = Impl2() // See also KT-10384: in non-error functions, as is necessary! fun add1(x: Impl2, y: Base): Impl1 = x as Base + y -fun error1(x: Impl2, y: Base): Impl1 = x + y +fun error1(x: Impl2, y: Base): Impl1 = x + y fun add2(x: Base, y: Impl2): Impl1 = x + y as Base -fun error2(x: Base, y: Impl2): Impl1 = x + y +fun error2(x: Base, y: Impl2): Impl1 = x + y fun minus3(x: Impl2): Impl1 = -(x as Base) diff --git a/compiler/testData/diagnostics/tests/cast/AsInBlockWithReturnType.kt b/compiler/testData/diagnostics/tests/cast/AsInBlockWithReturnType.kt index 4aba14b77f2..07734c128ab 100644 --- a/compiler/testData/diagnostics/tests/cast/AsInBlockWithReturnType.kt +++ b/compiler/testData/diagnostics/tests/cast/AsInBlockWithReturnType.kt @@ -6,7 +6,7 @@ fun runWithoutReturn(r: () -> Unit) = r() fun testRun() { run { 1 as Any - 1 as Any + 1 as Any } run { @@ -17,11 +17,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 { @@ -36,17 +36,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 b34a1411048..6a5f82470ab 100644 --- a/compiler/testData/diagnostics/tests/cast/UselessSafeCast.kt +++ b/compiler/testData/diagnostics/tests/cast/UselessSafeCast.kt @@ -11,7 +11,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 85ae68b45ce..dbbaa04a2ce 100644 --- a/compiler/testData/diagnostics/tests/cast/kt15161.kt +++ b/compiler/testData/diagnostics/tests/cast/kt15161.kt @@ -2,6 +2,6 @@ class Array(e: E) { val k = Array(1) { 1 as Any - e as Any? + e as Any? } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/checkArguments/SpreadVarargs.kt b/compiler/testData/diagnostics/tests/checkArguments/SpreadVarargs.kt index 4d40493000d..9e5c2ddcb98 100644 --- a/compiler/testData/diagnostics/tests/checkArguments/SpreadVarargs.kt +++ b/compiler/testData/diagnostics/tests/checkArguments/SpreadVarargs.kt @@ -43,10 +43,10 @@ fun main(args : Array) { 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(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 0f7e0eec970..534666d631c 100644 --- a/compiler/testData/diagnostics/tests/checkArguments/arrayAccessSetTooManyArgs.kt +++ b/compiler/testData/diagnostics/tests/checkArguments/arrayAccessSetTooManyArgs.kt @@ -6,6 +6,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/booleanExpressions.kt b/compiler/testData/diagnostics/tests/checkArguments/booleanExpressions.kt index ef0b86b1202..65c6b28d2b9 100644 --- a/compiler/testData/diagnostics/tests/checkArguments/booleanExpressions.kt +++ b/compiler/testData/diagnostics/tests/checkArguments/booleanExpressions.kt @@ -1,7 +1,7 @@ // !WITH_NEW_INFERENCE fun foo1(b: Boolean, c: Int) { - if (b && c) {} - if (b || c) {} - if (c && b) {} - if (c || b) {} + if (b && c) {} + if (b || c) {} + if (c && b) {} + if (c || b) {} } diff --git a/compiler/testData/diagnostics/tests/checkArguments/kt1897_diagnostic_part.kt b/compiler/testData/diagnostics/tests/checkArguments/kt1897_diagnostic_part.kt index b28554c4250..b310e4485ce 100644 --- a/compiler/testData/diagnostics/tests/checkArguments/kt1897_diagnostic_part.kt +++ b/compiler/testData/diagnostics/tests/checkArguments/kt1897_diagnostic_part.kt @@ -25,5 +25,5 @@ fun test() { foo("", 1) {} - foo("", 1) {} {} + foo("", 1) {} {} } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/checkArguments/overloadedFunction.kt b/compiler/testData/diagnostics/tests/checkArguments/overloadedFunction.kt index b39c39f0d55..4ebcaa07984 100644 --- a/compiler/testData/diagnostics/tests/checkArguments/overloadedFunction.kt +++ b/compiler/testData/diagnostics/tests/checkArguments/overloadedFunction.kt @@ -12,6 +12,6 @@ fun test() { foo(1, 2) foo("") - bar(1, 2) + bar(1, 2) bar() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/checkType.kt b/compiler/testData/diagnostics/tests/checkType.kt index c6f3d382865..981487c2cba 100644 --- a/compiler/testData/diagnostics/tests/checkType.kt +++ b/compiler/testData/diagnostics/tests/checkType.kt @@ -7,6 +7,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 4a44ef45a11..c6f263b033b 100644 --- a/compiler/testData/diagnostics/tests/collectionLiterals/argumentsOfAnnotation.kt +++ b/compiler/testData/diagnostics/tests/collectionLiterals/argumentsOfAnnotation.kt @@ -9,7 +9,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 22561de60ba..f93f45e4615 100644 --- a/compiler/testData/diagnostics/tests/collectionLiterals/argumentsOfAnnotationWithKClass.kt +++ b/compiler/testData/diagnostics/tests/collectionLiterals/argumentsOfAnnotationWithKClass.kt @@ -21,10 +21,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 99756e64ef9..b75672b70d7 100644 --- a/compiler/testData/diagnostics/tests/collectionLiterals/basicCollectionLiterals.kt +++ b/compiler/testData/diagnostics/tests/collectionLiterals/basicCollectionLiterals.kt @@ -3,11 +3,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] @@ -20,5 +20,5 @@ fun check() { val f: IntArray = [1] [f] checkType { _>() } - [1, ""] checkType { _>() } + [1, ""] checkType { _>() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/collectionLiterals/collectionLiteralsWithVarargs.kt b/compiler/testData/diagnostics/tests/collectionLiterals/collectionLiteralsWithVarargs.kt index 02bff8c55e5..012128a1de3 100644 --- a/compiler/testData/diagnostics/tests/collectionLiterals/collectionLiteralsWithVarargs.kt +++ b/compiler/testData/diagnostics/tests/collectionLiterals/collectionLiteralsWithVarargs.kt @@ -17,7 +17,7 @@ fun test1_0() {} @Ann1(*["a", "b"]) fun test1_1() {} -@Ann1(*["a", 1, null]) +@Ann1(*["a", 1, null]) fun test1_2() {} @Ann2(*[]) @@ -34,8 +34,8 @@ fun test6() {} annotation class AnnArray(val a: Array) -@AnnArray(*["/"]) +@AnnArray(*["/"]) fun testArray() {} -@Ann1([""]) +@Ann1([""]) fun testVararg() {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/collectionLiterals/defaultValuesInAnnotation.kt b/compiler/testData/diagnostics/tests/collectionLiterals/defaultValuesInAnnotation.kt index 883331c7713..d41d6948ca7 100644 --- a/compiler/testData/diagnostics/tests/collectionLiterals/defaultValuesInAnnotation.kt +++ b/compiler/testData/diagnostics/tests/collectionLiterals/defaultValuesInAnnotation.kt @@ -8,9 +8,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( @@ -22,5 +22,5 @@ annotation class Base( annotation class Err( val a: IntArray = [1L], - val b: Array = [1] + val b: Array = [1] ) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/collectionLiterals/noCollectionLiterals.kt b/compiler/testData/diagnostics/tests/collectionLiterals/noCollectionLiterals.kt index d1293f821ff..3d677a29bca 100644 --- a/compiler/testData/diagnostics/tests/collectionLiterals/noCollectionLiterals.kt +++ b/compiler/testData/diagnostics/tests/collectionLiterals/noCollectionLiterals.kt @@ -6,7 +6,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 cd8eebbfb56..f05e034c6d9 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/UninitializedOrReassignedVariables.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/UninitializedOrReassignedVariables.kt @@ -241,7 +241,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 bfebe75b35d..c49465ae326 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/fieldAsClassDelegate.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/fieldAsClassDelegate.kt index 38e94442b8a..3b721d9895d 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/fieldAsClassDelegate.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/fieldAsClassDelegate.kt @@ -28,7 +28,7 @@ private fun lazy(init: () -> T): kotlin.Lazy { } object DefaultHttpClientWithBy : HttpClient by client { - val client by lazy { HttpClientImpl() } + val client by lazy { HttpClientImpl() } } object DefaultFqHttpClient : HttpClient by DefaultFqHttpClient.client { diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt10805.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt10805.kt index 1b3b86cbf64..54d39e6c795 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt10805.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt10805.kt @@ -1,11 +1,11 @@ // !WITH_NEW_INFERENCE // AssertionError for nested ifs with lambdas and Nothing as results -val fn = if (true) { - { true } +val fn = if (true) { + { true } } else if (true) { - { true } + { true } } else { null!! diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/throwInLambda.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/throwInLambda.kt index 8709111de38..08216a5ae4b 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/ForLoopWithExtensionIteratorOnNullable.kt b/compiler/testData/diagnostics/tests/controlStructures/ForLoopWithExtensionIteratorOnNullable.kt index 419a961aa80..541f8f48c27 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/ForLoopWithExtensionIteratorOnNullable.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/ForLoopWithExtensionIteratorOnNullable.kt @@ -18,5 +18,5 @@ class OtherContainer(val k: K) { fun test2() { val other: OtherContainer? = null // Error - for (s in other) {} + for (s in other) {} } diff --git a/compiler/testData/diagnostics/tests/controlStructures/ifElseIntersection.kt b/compiler/testData/diagnostics/tests/controlStructures/ifElseIntersection.kt index 63abe881206..0426df66121 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/ifElseIntersection.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/ifElseIntersection.kt @@ -9,7 +9,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 } @@ -25,10 +25,10 @@ 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 4237d2bcdd5..16b80722321 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/ifInResultOfLambda.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/ifInResultOfLambda.kt @@ -1,7 +1,7 @@ // !WITH_NEW_INFERENCE -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 d57f2448335..0683a8d26f9 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/ifToAnyDiscriminatingUsages.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/ifToAnyDiscriminatingUsages.kt @@ -17,8 +17,8 @@ fun testResultOfLambda2() = fun testResultOfAnonFun1() = run(fun () = - if (true) 42 - else println() + if (true) 42 + else println() ) fun testResultOfAnonFun2() = @@ -28,7 +28,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 a16550b46d7..e1919cfa837 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/ifWhenWithoutElse.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/ifWhenWithoutElse.kt @@ -20,10 +20,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 } @@ -51,8 +51,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 419d599d6a7..d66646b08e3 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/improperElseInExpression.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/improperElseInExpression.kt @@ -30,5 +30,5 @@ fun example() { return if (true) true } - return if (true) true else {} + return if (true) true else {} } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/controlStructures/kt1075.kt b/compiler/testData/diagnostics/tests/controlStructures/kt1075.kt index 16d87b415c0..98b5c0b356a 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/kt1075.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/kt1075.kt @@ -5,7 +5,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 a799a2887f3..90d1e3ba2f7 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/kt4310.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/kt4310.kt @@ -4,9 +4,9 @@ package f fun test(a: Boolean, b: Boolean): Int { return if(a) { 1 - } else { - if (b) { + } else { + if (b) { 3 } - } + } } \ No newline at end of file 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 374b3eb29e6..bdcbf94e711 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/kt770.kt351.kt735_StatementType.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/kt770.kt351.kt735_StatementType.kt @@ -27,7 +27,7 @@ fun foo() { z = 34 } } - val f: ()-> Int = r + val f: ()-> Int = r val g: ()-> Any = r } @@ -80,7 +80,7 @@ fun testCoercionToUnit() { 45 } } - val f : () -> String = checkType + val f : () -> String = checkType } fun doSmth(i: Int) {} @@ -107,12 +107,12 @@ fun testImplicitCoercion() { val g = if (true) 4 val h = if (false) 4 else {} - bar(if (true) { + bar(if (true) { 4 } else { z = 342 - }) + }) } fun fooWithAnyArg(arg: Any) {} diff --git a/compiler/testData/diagnostics/tests/controlStructures/lambdasInExclExclAndElvis.kt b/compiler/testData/diagnostics/tests/controlStructures/lambdasInExclExclAndElvis.kt index 14a9f354a07..4885f22e845 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/lambdasInExclExclAndElvis.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/lambdasInExclExclAndElvis.kt @@ -9,8 +9,8 @@ fun test() { // KT-KT-9070 { } ?: 1 - use({ 2 } ?: 1); + use({ 2 } ?: 1); 1 ?: { } - use(1 ?: { }) + use(1 ?: { }) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/controlStructures/specialConstructsAndPlatformTypes.kt b/compiler/testData/diagnostics/tests/controlStructures/specialConstructsAndPlatformTypes.kt index 09c07f57eab..a4015e3306e 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/specialConstructsAndPlatformTypes.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/specialConstructsAndPlatformTypes.kt @@ -12,7 +12,7 @@ public class J { val testImplicitExclExcl1: String = J.s val testImplicitExclExcl2: String? = J.s -val testImplicitExclExcl3: String = J.m[""] +val testImplicitExclExcl3: String = J.m[""] val testImplicitExclExcl4: String? = J.m[""] val testExclExcl1: String = J.s!! @@ -30,7 +30,7 @@ val testSafeCall4: String? = J.m[""]?.let { it.toString() } val testIf1: String = if (true) J.s else J.s val testIf2: String? = if (true) J.s else J.s -val testIf3: String = if (true) J.m[""] else J.m[""] +val testIf3: String = if (true) J.m[""] else J.m[""] val testIf4: String? = if (true) J.m[""] else J.m[""] val testWhen1: String = when { else -> J.s } diff --git a/compiler/testData/diagnostics/tests/controlStructures/tryReturnType.kt b/compiler/testData/diagnostics/tests/controlStructures/tryReturnType.kt index fe469fa13e0..bf6b56583a9 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/tryReturnType.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/tryReturnType.kt @@ -15,7 +15,7 @@ fun foo() : Int { fun bar() : Int = try { - doSmth() + doSmth() } catch (e: Exception) { "" diff --git a/compiler/testData/diagnostics/tests/controlStructures/typeInferenceForExclExcl.kt b/compiler/testData/diagnostics/tests/controlStructures/typeInferenceForExclExcl.kt index e57b12576f4..2ed8fb1d329 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/typeInferenceForExclExcl.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/typeInferenceForExclExcl.kt @@ -13,9 +13,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 { _() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/controlStructures/whenInResultOfLambda.kt b/compiler/testData/diagnostics/tests/controlStructures/whenInResultOfLambda.kt index e8374d893e0..ce2b57c7e50 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/whenInResultOfLambda.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/whenInResultOfLambda.kt @@ -1,7 +1,7 @@ // !WITH_NEW_INFERENCE -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/cyclicHierarchy/kt303.kt b/compiler/testData/diagnostics/tests/cyclicHierarchy/kt303.kt index 6a10987081e..6f9879f4238 100644 --- a/compiler/testData/diagnostics/tests/cyclicHierarchy/kt303.kt +++ b/compiler/testData/diagnostics/tests/cyclicHierarchy/kt303.kt @@ -9,4 +9,4 @@ open class Bar() : Foo() { } -val x : Int = Foo() +val x : Int = Foo() diff --git a/compiler/testData/diagnostics/tests/dataClasses/extensionComponentsOnNullable.kt b/compiler/testData/diagnostics/tests/dataClasses/extensionComponentsOnNullable.kt index 3697d06dd62..683c832d6c6 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/extensionComponentsOnNullable.kt +++ b/compiler/testData/diagnostics/tests/dataClasses/extensionComponentsOnNullable.kt @@ -9,7 +9,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,6 +17,6 @@ data class NormalData(val x: T, val y: T) fun bar(): Int { val d: NormalData? = null // An error must be here - val (x, y) = d - return x + y + val (x, y) = d + return x + y } diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/BinaryExpression.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/BinaryExpression.kt index 6eb295bee25..06f3e506011 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 317f7af809c..4499a4f5fe8 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/dataFlowInfoTraversal/Return.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/Return.kt index 11b2ad64fa6..526dc02d163 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/Return.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/Return.kt @@ -14,5 +14,5 @@ fun foo(): Int { val z: Int? = null if (z != null) return if (z == null) z else z - return z + return z } diff --git a/compiler/testData/diagnostics/tests/declarationChecks/ComponentFunctionReturnTypeMismatch.kt b/compiler/testData/diagnostics/tests/declarationChecks/ComponentFunctionReturnTypeMismatch.kt index 71e9390c6d3..0e15d8c1d53 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/ComponentFunctionReturnTypeMismatch.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/ComponentFunctionReturnTypeMismatch.kt @@ -5,5 +5,5 @@ class A { } fun a(aa : A) { - val (a: String, b1: String) = aa + val (a: String, b1: String) = aa } diff --git a/compiler/testData/diagnostics/tests/declarationChecks/MultiDeclarationErrors.kt b/compiler/testData/diagnostics/tests/declarationChecks/MultiDeclarationErrors.kt index 4f0debaae31..d2082c5cf17 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/MultiDeclarationErrors.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/MultiDeclarationErrors.kt @@ -11,7 +11,7 @@ class MyClass2 {} fun MyClass2.component1() = 1.3 fun test(mc1: MyClass, mc2: MyClass2) { - val (a, b) = mc1 + val (a, b) = mc1 val (c) = mc2 //a,b,c are error types diff --git a/compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/FolLoopTypeComponentTypeMismatch.kt b/compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/FolLoopTypeComponentTypeMismatch.kt index cc370383f35..18898c2e515 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/FolLoopTypeComponentTypeMismatch.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/FolLoopTypeComponentTypeMismatch.kt @@ -9,7 +9,7 @@ class C { } fun test() { - for ((x: Double, y: Int) in C()) { + for ((x: Double, y: Int) in C()) { } } diff --git a/compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/ForLoopMissingLoopParameter.kt b/compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/ForLoopMissingLoopParameter.kt index 4215add1e0d..af5f7e11bbf 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/ForLoopMissingLoopParameter.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/ForLoopMissingLoopParameter.kt @@ -1,8 +1,8 @@ // !WITH_NEW_INFERENCE fun useDeclaredVariables() { for ((a, b)) { - a - b + a + b } } diff --git a/compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/underscore.kt b/compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/underscore.kt index c2df2eaa858..de77a4a7c93 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/underscore.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/underscore.kt @@ -26,7 +26,7 @@ fun test() { foo(_, _) } - for ((_ : String, _ : Int) in C()) { + for ((_ : String, _ : Int) in C()) { foo(_, _) } diff --git a/compiler/testData/diagnostics/tests/declarationChecks/namedFunAsLastExpressionInBlock.kt b/compiler/testData/diagnostics/tests/declarationChecks/namedFunAsLastExpressionInBlock.kt index bddb32d6643..848417f9a07 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/namedFunAsLastExpressionInBlock.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/namedFunAsLastExpressionInBlock.kt @@ -27,15 +27,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 = { diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.kt index 90c36a214d7..3b587e9a4c0 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.kt @@ -10,10 +10,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 27bb40cc86f..dda04dffa4d 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionProperty.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionProperty.kt @@ -4,10 +4,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 e145febdca4..6a4e9ec254f 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethodInGenericClass.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethodInGenericClass.kt @@ -8,7 +8,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,5 +24,5 @@ class C() { operator fun setValue(t: Any?, p: KProperty<*>, x: T) = Unit } -var c1: Int by C() -var c2: Int by C() +var c1: 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 8c2438f1695..48d970aad18 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/manyIncompleteCandidates.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/manyIncompleteCandidates.kt @@ -5,7 +5,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 bfb76a26ee3..2a587abd4d2 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/noErrorsForImplicitConstraints.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/noErrorsForImplicitConstraints.kt @@ -4,8 +4,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() @@ -24,8 +24,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 dbf61dbbf42..e6c7cd2abd5 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/inference/useExpectedType.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/useExpectedType.kt index 6ca8cd71cc2..c38ea969320 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/useExpectedType.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/useExpectedType.kt @@ -52,12 +52,12 @@ class MyProperty2 { //-------------------------- class A3 { - var a3: String by MyProperty3() - var b3: String by getMyProperty3() + var a3: String by MyProperty3() + var b3: String by getMyProperty3() } -var c3: String by getMyProperty3() -var d3: String by MyProperty3() +var c3: String by getMyProperty3() +var d3: String by MyProperty3() fun getMyProperty3() = MyProperty3() diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/commonCaseForInference.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/commonCaseForInference.kt index f2e246824bb..8f5b12b2ebb 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/commonCaseForInference.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/commonCaseForInference.kt @@ -9,6 +9,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 } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver2.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver2.kt index 38555dbe7ae..fe84deddff2 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver2.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver2.kt @@ -10,5 +10,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() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/inferenceFromReceiver1.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/inferenceFromReceiver1.kt index 2353da77172..052baa62c34 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/inferenceFromReceiver1.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/inferenceFromReceiver1.kt @@ -9,7 +9,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 10ae5d9bd85..e3acda6d2ce 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/inferenceFromReceiver2.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/inferenceFromReceiver2.kt @@ -9,6 +9,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 6cc2b6c2221..e1740e837a5 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/noOperatorModifierOnProvideDelegate.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/noOperatorModifierOnProvideDelegate.kt @@ -13,6 +13,6 @@ 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 0ffc2b7123e..06cb917614c 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/setValue.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/setValue.kt @@ -8,10 +8,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, "") \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/unsupportedOperatorProvideDelegate.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/unsupportedOperatorProvideDelegate.kt index ce168f0cb2a..d73903ce1e0 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/unsupportedOperatorProvideDelegate.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/unsupportedOperatorProvideDelegate.kt @@ -11,5 +11,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" \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/recursiveType.kt b/compiler/testData/diagnostics/tests/delegatedProperty/recursiveType.kt index ed4910e17ae..41e4392d738 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 c by d +val d by c class Delegate(i: Int) { operator fun getValue(t: Any?, p: KProperty<*>): Int { diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/twoGetMethods.kt b/compiler/testData/diagnostics/tests/delegatedProperty/twoGetMethods.kt index dbd48b7771c..2d426cabf65 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/twoGetMethods.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/twoGetMethods.kt @@ -4,7 +4,7 @@ import kotlin.reflect.KProperty class A { - val c: Int by Delegate() + val c: Int by Delegate() } class Delegate { diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetReturnType.kt b/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetReturnType.kt index 884b0ccfedb..4da869760da 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetReturnType.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetReturnType.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/delegation/DelegationExpectedType.kt b/compiler/testData/diagnostics/tests/delegation/DelegationExpectedType.kt index e006456400e..2e237f6e3b3 100644 --- a/compiler/testData/diagnostics/tests/delegation/DelegationExpectedType.kt +++ b/compiler/testData/diagnostics/tests/delegation/DelegationExpectedType.kt @@ -21,6 +21,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() \ No newline at end of file +class F : A by AImpl() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/delegation/clashes/finalMemberOverridden.kt b/compiler/testData/diagnostics/tests/delegation/clashes/finalMemberOverridden.kt index dc6663af184..5a0a087013d 100644 --- a/compiler/testData/diagnostics/tests/delegation/clashes/finalMemberOverridden.kt +++ b/compiler/testData/diagnostics/tests/delegation/clashes/finalMemberOverridden.kt @@ -53,4 +53,4 @@ class CBarT : IBarT { class Test7 : Final(), IBarT by CBarT() -class Test8 : Final(), IBarT by CBar() +class Test8 : Final(), IBarT by CBar() diff --git a/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/severalDelegates.kt b/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/severalDelegates.kt index bd64c1c5372..8ccce102da5 100644 --- a/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/severalDelegates.kt +++ b/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/severalDelegates.kt @@ -23,6 +23,6 @@ public abstract class MyClass : Base1, Base2 { } } -class A : MyClass(), Base1 by Delegate1(), Base1 by Delegate2() { +class A : MyClass(), Base1 by Delegate1(), Base1 by Delegate2() { } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/deparenthesize/checkDeparenthesizedType.kt b/compiler/testData/diagnostics/tests/deparenthesize/checkDeparenthesizedType.kt index 5aec4f66a06..a916759e485 100644 --- a/compiler/testData/diagnostics/tests/deparenthesize/checkDeparenthesizedType.kt +++ b/compiler/testData/diagnostics/tests/deparenthesize/checkDeparenthesizedType.kt @@ -14,7 +14,7 @@ fun test(i: Int?) { val a: Int = l4@ "" val b: Int = ("") val c: Int = checkSubtype("") - val d: Int = checkSubtype("") + val d: Int = checkSubtype("") foo(l4@ "") diff --git a/compiler/testData/diagnostics/tests/enum/kt8972_cloneNotAllowed.kt b/compiler/testData/diagnostics/tests/enum/kt8972_cloneNotAllowed.kt index 852a7c91dba..beb3fdd1e18 100644 --- a/compiler/testData/diagnostics/tests/enum/kt8972_cloneNotAllowed.kt +++ b/compiler/testData/diagnostics/tests/enum/kt8972_cloneNotAllowed.kt @@ -2,6 +2,6 @@ enum class E : Cloneable { A; override fun clone(): Any { - return super.clone() + return super.clone() } } diff --git a/compiler/testData/diagnostics/tests/evaluate/binaryMinusIndependentExpType.kt b/compiler/testData/diagnostics/tests/evaluate/binaryMinusIndependentExpType.kt index ae12df8f6b6..987b45a3504 100644 --- a/compiler/testData/diagnostics/tests/evaluate/binaryMinusIndependentExpType.kt +++ b/compiler/testData/diagnostics/tests/evaluate/binaryMinusIndependentExpType.kt @@ -1,24 +1,26 @@ +// !WITH_NEW_INFERENCE + val p1: Int = 1 - 1 -val p2: Long = 1 - 1 -val p3: Byte = 1 - 1 -val p4: Short = 1 - 1 +val p2: Long = 1 - 1 +val p3: Byte = 1 - 1 +val p4: Short = 1 - 1 val l1: Long = 1 - 1.toLong() -val l2: Byte = 1 - 1.toLong() -val l3: Int = 1 - 1.toLong() -val l4: Short = 1 - 1.toLong() +val l2: Byte = 1 - 1.toLong() +val l3: Int = 1 - 1.toLong() +val l4: Short = 1 - 1.toLong() -val b1: Byte = 1 - 1.toByte() +val b1: Byte = 1 - 1.toByte() val b2: Int = 1 - 1.toByte() -val b3: Long = 1 - 1.toByte() -val b4: Short = 1 - 1.toByte() +val b3: Long = 1 - 1.toByte() +val b4: Short = 1 - 1.toByte() -val i1: Byte = 1 - 1.toInt() +val i1: Byte = 1 - 1.toInt() val i2: Int = 1 - 1.toInt() -val i3: Long = 1 - 1.toInt() -val i4: Short = 1 - 1.toInt() +val i3: Long = 1 - 1.toInt() +val i4: Short = 1 - 1.toInt() -val s1: Byte = 1 - 1.toShort() +val s1: Byte = 1 - 1.toShort() val s2: Int = 1 - 1.toShort() -val s3: Long = 1 - 1.toShort() -val s4: Short = 1 - 1.toShort() \ No newline at end of file +val s3: Long = 1 - 1.toShort() +val s4: Short = 1 - 1.toShort() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/evaluate/divisionByZero.kt b/compiler/testData/diagnostics/tests/evaluate/divisionByZero.kt index 46af506ac30..759b11b59c0 100644 --- a/compiler/testData/diagnostics/tests/evaluate/divisionByZero.kt +++ b/compiler/testData/diagnostics/tests/evaluate/divisionByZero.kt @@ -1,4 +1,5 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE +// !WITH_NEW_INFERENCE val a1 = 0 val a2 = 1 / 0 @@ -11,7 +12,7 @@ val a7 = 1.div(a1) val a8 = 1.div(a2) val a9 = 2 * (1.div(0)) -val b1: Byte = 1 / 0 +val b1: Byte = 1 / 0 @Ann(1 / 0) val b2 = 1 annotation class Ann(val i : Int) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/evaluate/parentesized.kt b/compiler/testData/diagnostics/tests/evaluate/parentesized.kt index 8070e900c7d..449602f4add 100644 --- a/compiler/testData/diagnostics/tests/evaluate/parentesized.kt +++ b/compiler/testData/diagnostics/tests/evaluate/parentesized.kt @@ -1,10 +1,12 @@ -val p1: Byte = (1 + 2) * 2 -val p2: Short = (1 + 2) * 2 -val p3: Int = (1 + 2) * 2 -val p4: Long = (1 + 2) * 2 +// !WITH_NEW_INFERENCE -val b1: Byte = (1.toByte() + 2) * 2 -val b2: Short = (1.toShort() + 2) * 2 +val p1: Byte = (1 + 2) * 2 +val p2: Short = (1 + 2) * 2 +val p3: Int = (1 + 2) * 2 +val p4: Long = (1 + 2) * 2 + +val b1: Byte = (1.toByte() + 2) * 2 +val b2: Short = (1.toShort() + 2) * 2 val b3: Int = (1.toInt() + 2) * 2 val b4: Long = (1.toLong() + 2) * 2 diff --git a/compiler/testData/diagnostics/tests/extensions/ExtensionFunctions.kt b/compiler/testData/diagnostics/tests/extensions/ExtensionFunctions.kt index 65a9cf90f7d..2b2261ef62e 100644 --- a/compiler/testData/diagnostics/tests/extensions/ExtensionFunctions.kt +++ b/compiler/testData/diagnostics/tests/extensions/ExtensionFunctions.kt @@ -20,7 +20,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/classObject.kt b/compiler/testData/diagnostics/tests/extensions/classObject.kt index 59081a07c2b..16cce36e018 100644 --- a/compiler/testData/diagnostics/tests/extensions/classObject.kt +++ b/compiler/testData/diagnostics/tests/extensions/classObject.kt @@ -15,6 +15,6 @@ fun test() { A.f2() B.f3() B.f4() - A.f5() - B.f5() + A.f5() + B.f5() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/extensions/kt1875.kt b/compiler/testData/diagnostics/tests/extensions/kt1875.kt index 032595a5271..05c21438a17 100644 --- a/compiler/testData/diagnostics/tests/extensions/kt1875.kt +++ b/compiler/testData/diagnostics/tests/extensions/kt1875.kt @@ -10,13 +10,13 @@ interface T { } fun test(t: T) { - t.f(1) //unsafe call error + t.f(1) //unsafe call error t.f?.invoke(1) } fun test1(t: T?) { t.f(1) // todo resolve f as value and report UNSAFE_CALL - t?.f(1) + t?.f(1) t.f?.invoke(1) t?.f?.invoke(1) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/extensions/kt3563.kt b/compiler/testData/diagnostics/tests/extensions/kt3563.kt index ff7ec890495..e1c517496d2 100644 --- a/compiler/testData/diagnostics/tests/extensions/kt3563.kt +++ b/compiler/testData/diagnostics/tests/extensions/kt3563.kt @@ -10,7 +10,7 @@ class Customer(name1: String) fun foo(f: File, c: Customer) { f.name1 - c.name1 // name1 should be unresolved here + c.name1 // name1 should be unresolved here } val File.name1: String diff --git a/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver.kt b/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver.kt index 5eb7c0d0178..41853015366 100644 --- a/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver.kt +++ b/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver.kt @@ -7,28 +7,28 @@ package bar fun List.a() {} fun test1(i: Int?) { - 1.a() - i.a() + 1.a() + i.a() } fun test2(c: Collection) { - c.a() + c.a() } fun Int.foo() {} fun test3(s: String?) { - "".foo() - s.foo() - "".foo(1) - s.foo("a") + "".foo() + s.foo() + "".foo(1) + s.foo("a") } interface A fun T.c() {} fun test4() { - 1.c() + 1.c() } @@ -41,16 +41,16 @@ fun test5() { fun R?.sure() : R = this!! fun test6(l: List?) { - l.sure<T>() + l.sure<T>() } fun List.b() {} fun test7(l: List) { - l.b() + l.b() } fun test8(l: List?) { - l.b() + l.b() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver2.kt b/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver2.kt index ed920c74b81..79868e08a13 100644 --- a/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver2.kt +++ b/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver2.kt @@ -6,7 +6,7 @@ class A {} fun test(a1: A, a2: A) { val range = "island".."isle" - a1..a2 + a1..a2 } diff --git a/compiler/testData/diagnostics/tests/functionAsExpression/FunctionType.kt b/compiler/testData/diagnostics/tests/functionAsExpression/FunctionType.kt index fe07efb7534..024f02028d2 100644 --- a/compiler/testData/diagnostics/tests/functionAsExpression/FunctionType.kt +++ b/compiler/testData/diagnostics/tests/functionAsExpression/FunctionType.kt @@ -9,7 +9,7 @@ fun testReturnType(foo: String) { val bas: () -> String = fun () = foo - val bag: () -> Int = fun () = foo + val bag: () -> Int = fun () = foo } fun testParamType() { @@ -18,7 +18,7 @@ fun testParamType() { bar.checkType { _<(String) -> Unit>() } val bas: (String) -> Unit = fun (param: String) {} - val bag: (Int) -> Unit = fun (param: String) {} + val bag: (Int) -> Unit = fun (param: String) {} } fun testReceiverType() { @@ -28,5 +28,5 @@ fun testReceiverType() { val bas: String.() -> Unit = fun String.() {} - val bag: Int.() -> Unit = fun String.() {} + val bag: Int.() -> Unit = fun String.() {} } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionAsExpression/InferenceParametersTypes.kt b/compiler/testData/diagnostics/tests/functionAsExpression/InferenceParametersTypes.kt index 72e7f6bdd2d..b458f865a91 100644 --- a/compiler/testData/diagnostics/tests/functionAsExpression/InferenceParametersTypes.kt +++ b/compiler/testData/diagnostics/tests/functionAsExpression/InferenceParametersTypes.kt @@ -12,9 +12,9 @@ fun test(a: (Int) -> Int) { } fun test2(a: () -> List) { - test2(fun () = listOf()) + test2(fun () = listOf()) } val a: (Int) -> Unit = fun(x) { checkSubtype(x) } -val b: (Int) -> Unit = fun(x: String) {} \ No newline at end of file +val b: (Int) -> Unit = fun(x: String) {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionAsExpression/MissingParameterTypes.kt b/compiler/testData/diagnostics/tests/functionAsExpression/MissingParameterTypes.kt index 962f0c4e082..34b51623d59 100644 --- a/compiler/testData/diagnostics/tests/functionAsExpression/MissingParameterTypes.kt +++ b/compiler/testData/diagnostics/tests/functionAsExpression/MissingParameterTypes.kt @@ -6,22 +6,22 @@ val a = fun (x) = Int = fun (x) = x + 3 -val c: (Int, String) -> Int = fun (x) = 3 +val c: (Int, String) -> Int = fun (x) = 3 -val d: (Int, String) -> Int = fun (x) = 3 +val d: (Int, String) -> Int = fun (x) = 3 -val e: (Int, String) -> Int = fun (x: String) = 3 +val e: (Int, String) -> Int = fun (x: String) = 3 -val f: (Int) -> Int = fun (x: String) = 3 +val f: (Int) -> Int = fun (x: String) = 3 fun test1(a: (Int) -> Unit) { test1(fun (x) { checkSubtype(x)}) } fun test2(a: (Int) -> Unit) { - test2(fun (x: String) {}) + test2(fun (x: String) {}) } fun test3(a: (Int, String) -> Unit) { - test3(fun (x: String) {}) + test3(fun (x: String) {}) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionAsExpression/ReceiverByExpectedType.kt b/compiler/testData/diagnostics/tests/functionAsExpression/ReceiverByExpectedType.kt index 18547d8c814..bad2c25b52f 100644 --- a/compiler/testData/diagnostics/tests/functionAsExpression/ReceiverByExpectedType.kt +++ b/compiler/testData/diagnostics/tests/functionAsExpression/ReceiverByExpectedType.kt @@ -1,3 +1,3 @@ // !WITH_NEW_INFERENCE fun foo(f: String.() -> Int) {} -val test = foo( Int; \(\) -> [ERROR : Error function type])!>fun () = length) \ No newline at end of file +val test = foo(fun () = length) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionAsExpression/WithGenericParameters.kt b/compiler/testData/diagnostics/tests/functionAsExpression/WithGenericParameters.kt index 75465b07f91..16c1fafa81c 100644 --- a/compiler/testData/diagnostics/tests/functionAsExpression/WithGenericParameters.kt +++ b/compiler/testData/diagnostics/tests/functionAsExpression/WithGenericParameters.kt @@ -12,8 +12,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 {}) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionLiterals/DeprecatedSyntax.kt b/compiler/testData/diagnostics/tests/functionLiterals/DeprecatedSyntax.kt index 39b118e1314..da688cdb353 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/DeprecatedSyntax.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/DeprecatedSyntax.kt @@ -10,7 +10,7 @@ val returnTypeWithParameter = { ( -> Int).() -> } -val parenthesizedParameters = { (a: Int) -> } +val parenthesizedParameters = { (a: Int) -> } val parenthesizedParameters2 = { (b) -> } val none = { -> } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/ExpectedParameterTypeMismatchVariance.kt b/compiler/testData/diagnostics/tests/functionLiterals/ExpectedParameterTypeMismatchVariance.kt index 36d113e6f6f..dc14a07cfac 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/ExpectedParameterTypeMismatchVariance.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/ExpectedParameterTypeMismatchVariance.kt @@ -16,6 +16,6 @@ fun test(s: Sub) { t: Trait -> s } - foo(fun(t: Sub) = s) + foo(fun(t: Sub) = s) foo(fun(t): Super = s) } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/ExpectedParametersTypesMismatch.kt b/compiler/testData/diagnostics/tests/functionLiterals/ExpectedParametersTypesMismatch.kt index 80055a25e80..5ddba708712 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/ExpectedParametersTypesMismatch.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/ExpectedParametersTypesMismatch.kt @@ -9,37 +9,37 @@ fun test1() { foo0 { "" } - foo0 { - s: String-> "" - } - foo0 { - x, y -> "" - } + foo0 { + s: String-> "" + } + foo0 { + x, y -> "" + } foo1 { "" } - foo1 { - s: String -> "" - } - foo1 { - x, y -> "" - } - foo1 { - -> 42 - } + foo1 { + s: String -> "" + } + foo1 { + x, y -> "" + } + foo1 { + -> 42 + } - foo2 { + foo2 { "" - } - foo2 { - s: String -> "" - } - foo2 { - x -> "" - } - foo2 { - -> 42 - } + } + foo2 { + s: String -> "" + } + foo2 { + x -> "" + } + foo2 { + -> 42 + } } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/LabeledFunctionLiterals.kt b/compiler/testData/diagnostics/tests/functionLiterals/LabeledFunctionLiterals.kt index 463ed38da0d..4309c625107 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/LabeledFunctionLiterals.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/LabeledFunctionLiterals.kt @@ -10,7 +10,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 97c91909c6c..c97a7bf338f 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambdaWithExpectedType.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambdaWithExpectedType.kt @@ -12,5 +12,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 dce0cffe9f8..d7e65afe274 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/complexInference.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/complexInference.kt @@ -30,8 +30,8 @@ fun bar(aInstance: A, bInstance: B) { d checkType { _() } } - foo(bInstance) { - (a, b), (c, d) -> + foo(bInstance) { + (a, b), (c, d) -> a checkType { _() } b checkType { _() } c checkType { _() } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/inferredFunctionalType.kt b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/inferredFunctionalType.kt index b6ef60e8d0d..7e1244e7913 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/inferredFunctionalType.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/inferredFunctionalType.kt @@ -22,13 +22,13 @@ fun bar(aList: List) { b checkType { _() } } - aList.foo { (a: String, b) -> - a checkType { _() } + aList.foo { (a: String, b) -> + a checkType { _() } 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 fe723635302..c8482754035 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) -> + val z = { (a: Int, b: String) -> 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 336a64b5aed..cbefe771655 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/redeclaration.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/redeclaration.kt @@ -8,23 +8,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 60ae9193374..d579dc46b2d 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/simple.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/simple.kt @@ -42,13 +42,13 @@ fun bar() { d checkType { _() } } - foo { (a: String, b) -> - a checkType { _() } + foo { (a: String, b) -> + a checkType { _() } 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 d7a1fe4254a..995ef00f2b6 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/underscore.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/underscore.kt @@ -51,13 +51,13 @@ fun bar() { _ checkType { _() } } - foo { (_: String, b) -> + foo { (_: String, b) -> _.hashCode() b checkType { _() } } - foo { (_, b): B -> + foo { (_, b): B -> _.hashCode() b checkType { _() } - } + } } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/functionLIteralInBlockInIf.kt b/compiler/testData/diagnostics/tests/functionLiterals/functionLIteralInBlockInIf.kt index 2052b15b123..0e07db55cba 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/functionLIteralInBlockInIf.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/functionLIteralInBlockInIf.kt @@ -3,9 +3,9 @@ fun test() { val a = if (true) { val x = 1 - ({ x }) + ({ x }) } else { - { 2 } + { 2 } } - a checkType { _<() -> Int>() } + a checkType { _<() -> Int>() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionLiterals/functionLiteralInIf.kt b/compiler/testData/diagnostics/tests/functionLiterals/functionLiteralInIf.kt index 7250191e86c..cb6b38f6b9f 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/functionLiteralInIf.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/functionLiteralInIf.kt @@ -5,9 +5,9 @@ import java.util.HashSet fun test123() { val g: (Int) -> Unit = if (true) { - val set = HashSet(); + val set = HashSet<Int>(); { i -> - set.add(i) + set.add(i) } } else { diff --git a/compiler/testData/diagnostics/tests/functionLiterals/kt7383_starProjectedFunction.kt b/compiler/testData/diagnostics/tests/functionLiterals/kt7383_starProjectedFunction.kt index 806c8d44bfb..de7b36e9e14 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/kt7383_starProjectedFunction.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/kt7383_starProjectedFunction.kt @@ -3,5 +3,5 @@ fun foo() { val f : Function1<*, *> = { x -> x.toString() } - f(1) + f(1) } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/ForbiddenNonLocalReturnNoType.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/ForbiddenNonLocalReturnNoType.kt index 0ad96640de8..037dec7797e 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/ForbiddenNonLocalReturnNoType.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/ForbiddenNonLocalReturnNoType.kt @@ -1,18 +1,18 @@ // !WITH_NEW_INFERENCE fun test() { run {return} - run {} + run {} } fun test2() { run {return@test2} - run {} + run {} } fun test3() { fun test4() { run {return@test3} - run {} + run {} } } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnNoCoercionToUnit.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnNoCoercionToUnit.kt index 248d8870097..bf99e0f31b5 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnNoCoercionToUnit.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnNoCoercionToUnit.kt @@ -2,6 +2,6 @@ fun test(a: Int) { run f@{ if (a > 0) return@f - else return@f 1 + else return@f 1 } } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnitAndDontCareType.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnitAndDontCareType.kt index fc408905233..8af214c3061 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnitAndDontCareType.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnitAndDontCareType.kt @@ -16,5 +16,5 @@ val b = run { val c = run { if (flag) return@run - return@run 4 + return@run 4 } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnsWithExplicitReturnType.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnsWithExplicitReturnType.kt index 955b61ef6f6..ea7ca3be1ac 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnsWithExplicitReturnType.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnsWithExplicitReturnType.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/functionLiterals/return/NoCommonSystem.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/NoCommonSystem.kt index bfdbecca669..633740ece71 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/NoCommonSystem.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/NoCommonSystem.kt @@ -6,10 +6,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 2a27046970a..13828c53c60 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 2db929cb4d7..ffab35ee182 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/returnNullWithReturn.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/returnNullWithReturn.kt @@ -5,7 +5,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") \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/generics/Projections.kt b/compiler/testData/diagnostics/tests/generics/Projections.kt index a8fc7e2d544..8c3847e51af 100644 --- a/compiler/testData/diagnostics/tests/generics/Projections.kt +++ b/compiler/testData/diagnostics/tests/generics/Projections.kt @@ -37,13 +37,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/capturedParameters/innerLocalClass.kt b/compiler/testData/diagnostics/tests/generics/capturedParameters/innerLocalClass.kt index c11d66dbe0e..7183754ea85 100644 --- a/compiler/testData/diagnostics/tests/generics/capturedParameters/innerLocalClass.kt +++ b/compiler/testData/diagnostics/tests/generics/capturedParameters/innerLocalClass.kt @@ -19,7 +19,7 @@ private class Outer { private var doubleStringInt = Outer().Inner().foo()() private fun bar() { - doubleCharSequenceInt = doubleStringNumber + doubleCharSequenceInt = doubleStringNumber doubleCharSequenceInt = doubleStringInt doubleStringInt = Outer().Inner().foo()() diff --git a/compiler/testData/diagnostics/tests/generics/capturedParameters/localClass.kt b/compiler/testData/diagnostics/tests/generics/capturedParameters/localClass.kt index 983949fc3e9..8f5b7adb8af 100644 --- a/compiler/testData/diagnostics/tests/generics/capturedParameters/localClass.kt +++ b/compiler/testData/diagnostics/tests/generics/capturedParameters/localClass.kt @@ -15,7 +15,7 @@ class Q { private var y = foo()() fun bar() { - x = y + x = y x = foo()() y = foo()() diff --git a/compiler/testData/diagnostics/tests/generics/capturedParameters/objectLiteral.kt b/compiler/testData/diagnostics/tests/generics/capturedParameters/objectLiteral.kt index 08cd7c2008a..c9ea22ad7b3 100644 --- a/compiler/testData/diagnostics/tests/generics/capturedParameters/objectLiteral.kt +++ b/compiler/testData/diagnostics/tests/generics/capturedParameters/objectLiteral.kt @@ -13,7 +13,7 @@ class Q { private var y = foo() fun bar() { - x = y + x = y x = foo() y = foo() diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/bareTypesComplex.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/bareTypesComplex.kt index 5ccf784ff3a..91b43ecc41b 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/bareTypesComplex.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/bareTypesComplex.kt @@ -4,7 +4,7 @@ open class SuperOuter { } class DerivedOuter : SuperOuter() { - inner class DerivedInner : SuperOuter.SuperInner() + inner class DerivedInner : SuperOuter.SuperInner() } fun bare(x: SuperOuter<*>.SuperInner<*>, y: Any?) { diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocal.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocal.kt index 8a32be9017b..e4967fe102f 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocal.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocal.kt @@ -45,7 +45,7 @@ fun test() { x().foo().a() checkType { _>() } x().bar() checkType { _>() } - x = foobar() + x = foobar() var y = noParameters() y = noParameters() diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocalInsideInner.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocalInsideInner.kt index 0c22f8c68f5..d5fdd6a53e9 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocalInsideInner.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocalInsideInner.kt @@ -46,8 +46,8 @@ class Outer { x().foo().a() checkType { _>() } x().bar() checkType { _>() } - x = foobar() - x = z.foobar() + x = foobar() + x = z.foobar() var y = noParameters() y = noParameters() diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/secondLevelDepth.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/secondLevelDepth.kt index 777355ae7eb..97a989504e3 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/secondLevelDepth.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/secondLevelDepth.kt @@ -9,7 +9,7 @@ open class Outer { } class DerivedOuter : Outer() { - inner class DerivedInner : Inner() { + inner class DerivedInner : Inner() { fun foo(): Inner2 = null!! } } diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/innerSuperCall.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/innerSuperCall.kt index 3f48aaab774..1b3c22785a8 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/innerSuperCall.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/innerSuperCall.kt @@ -6,5 +6,5 @@ open class Super { class Sub : Super() { // TODO: it would be nice to have a possibility to omit explicit type argument in supertype - inner class SubInner : Super.Inner() {} + inner class SubInner : Super.Inner() {} } diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/innerSuperCallSecondary.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/innerSuperCallSecondary.kt index 0855809c2d5..361bbd6838c 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/innerSuperCallSecondary.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/innerSuperCallSecondary.kt @@ -7,7 +7,7 @@ open class Super { class Sub : Super() { inner class SubInner : Super.Inner { - constructor() - constructor(x: Int) : super() {} + constructor() + constructor(x: Int) : super() {} } } diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/innerTP.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/innerTP.kt index 4eb8d8d9178..8fe1399f96f 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/innerTP.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/innerTP.kt @@ -32,7 +32,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 61dcd896d1d..d766cbcf95a 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/innerUncheckedCast.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/innerUncheckedCast.kt @@ -15,7 +15,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 f07b22b1fbf..87e065d0ce3 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/iterator.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/iterator.kt @@ -29,9 +29,9 @@ fun commonSupertype(x: E, y: E): E = x fun foo() { var myIt = A().iterator() - myIt = A().iterator() + myIt = A().iterator() 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/kt3357.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/kt3357.kt index 0cb6cd85823..0075e0814b9 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/kt3357.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/kt3357.kt @@ -8,7 +8,7 @@ open class Super { } class Sub(): Super() { - inner class SubInner : Super.Inner() { // 'Inner' is unresolved + inner class SubInner : Super.Inner() { // 'Inner' is unresolved // Also, T1 is not resolved to anything, and not marked as resolved init { val x: Super.Inner = this // T1 is not resolved to anything diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/qualifiedOuter.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/qualifiedOuter.kt index ca81c14fa53..4c8e862fbf7 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/qualifiedOuter.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/qualifiedOuter.kt @@ -6,12 +6,12 @@ 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>() } - inner = x + inner = x } class Nested diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/simpleOutUseSite.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/simpleOutUseSite.kt index 7aaca427048..4de5d3edb9b 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/simpleOutUseSite.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/simpleOutUseSite.kt @@ -29,9 +29,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/kt5508.kt b/compiler/testData/diagnostics/tests/generics/kt5508.kt index 7062b816b57..4c13070bdfc 100644 --- a/compiler/testData/diagnostics/tests/generics/kt5508.kt +++ b/compiler/testData/diagnostics/tests/generics/kt5508.kt @@ -6,7 +6,7 @@ abstract class A { public abstract fun bar(x: T) public inner abstract class B : A>() { - public inner class C : B>() + public inner class C : B>() { // Here B> means A.B>.B.B.C>>.B.B>.B.B.C>.C> // while for being a correct override it should be A.B>.B.B.C> diff --git a/compiler/testData/diagnostics/tests/generics/multipleBoundsMemberScope/simple.kt b/compiler/testData/diagnostics/tests/generics/multipleBoundsMemberScope/simple.kt index 3a76b1ca50c..cceef511679 100644 --- a/compiler/testData/diagnostics/tests/generics/multipleBoundsMemberScope/simple.kt +++ b/compiler/testData/diagnostics/tests/generics/multipleBoundsMemberScope/simple.kt @@ -9,6 +9,6 @@ interface B: A fun test(x: T) where T : C?, T : B? { x?.foo() if (x != null) { - x.foo() + x.foo() } } diff --git a/compiler/testData/diagnostics/tests/generics/nullability/expressionsBoundsViolation.kt b/compiler/testData/diagnostics/tests/generics/nullability/expressionsBoundsViolation.kt index 45cd5f14c74..aba7d454da2 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/expressionsBoundsViolation.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/expressionsBoundsViolation.kt @@ -7,13 +7,13 @@ 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/functionalBound.kt b/compiler/testData/diagnostics/tests/generics/nullability/functionalBound.kt index 973281e0a3a..33be58312e4 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/functionalBound.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/functionalBound.kt @@ -1,14 +1,14 @@ // !WITH_NEW_INFERENCE fun Unit)?> foo(x: E, y: T) { if (x != null) { - y(x) + y(x) } if (y != null) { - y(x) + y(x) } if (x != null && y != null) { - y(x) + y(x) } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/generics/nullability/smartCasts.kt b/compiler/testData/diagnostics/tests/generics/nullability/smartCasts.kt index e9c0731c2f9..d47c0e27222 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/smartCasts.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/smartCasts.kt @@ -12,13 +12,13 @@ fun foo(x: T) { if (x != null) { if (x != null) {} - x.length + x.length x?.length x.bar1() x.bar2() - x.bar3() - x.bar4() + x.bar3() + x.bar4() x?.bar1() @@ -32,14 +32,14 @@ fun foo(x: T) { x.bar1() x.bar2() - x.bar3() + x.bar3() } if (x is CharSequence) { 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 0de3ad6dcdb..671ecd63de0 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/smartCastsOnThis.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/smartCastsOnThis.kt @@ -11,13 +11,13 @@ fun T.foo() { if (this != null) { if (this != null) {} - length + length this?.length bar1() bar2() - bar3() - bar4() + bar3() + bar4() this?.bar1() @@ -31,6 +31,6 @@ fun T.foo() { bar1() bar2() - bar3() + bar3() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/generics/nullability/smartCastsValueArgument.kt b/compiler/testData/diagnostics/tests/generics/nullability/smartCastsValueArgument.kt index b801df60ee9..40cfc6d1fd9 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/smartCastsValueArgument.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/smartCastsValueArgument.kt @@ -11,12 +11,12 @@ fun foo(x: T) { if (x != null) { if (x != null) {} - y1 = x - y2 = x + y1 = x + y2 = x - bar1(x) - bar1(x) - bar2(x) + bar1(x) + bar1(x) + bar2(x) bar3(x) } @@ -24,14 +24,14 @@ fun foo(x: T) { y1 = x y2 = x - bar1(x) + bar1(x) bar2(x) bar3(x) } if (x is CharSequence) { y1 = x - y2 = x + y2 = x bar1(x) bar2(x) @@ -40,13 +40,13 @@ fun foo(x: T) { if (1 == 1) { val y = x!! - bar1(x) - bar1(x) - bar2(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 0e17f24a8dd..254e02a3aa8 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/tpBoundsViolation.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/tpBoundsViolation.kt @@ -18,7 +18,7 @@ class A { x2.checkType { _() } foo1<F?>(y) - foo1(y) + foo1(y) foo2(y) val x3 = foo2(y) @@ -38,7 +38,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 70f8276d48a..9525eb00ecf 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/tpBoundsViolationVariance.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/tpBoundsViolationVariance.kt @@ -18,9 +18,9 @@ class A { fun bar() { // F fooInv1>(Inv()) - fooInv2<Inv>(Inv()) + fooInv2<Inv>(Inv()) fooInv1(Inv()) - fooInv2(Inv()) + fooInv2(Inv()) fooIn1>(In()) fooIn2>(In()) @@ -33,15 +33,15 @@ class A { fooOut2(Out()) // Z - fooInv1<Inv>(Inv()) - fooInv2<Inv>(Inv()) - fooInv1(Inv()) - fooInv2(Inv()) + fooInv1<Inv>(Inv()) + fooInv2<Inv>(Inv()) + fooInv1(Inv()) + fooInv2(Inv()) - fooIn1<In>(In()) - fooIn2<In>(In()) - fooIn1(In()) - fooIn2(In()) + fooIn1<In>(In()) + fooIn2<In>(In()) + fooIn1(In()) + fooIn2(In()) fooOut1>(Out()) fooOut2>(Out()) @@ -49,19 +49,19 @@ class A { fooOut2(Out()) // W - fooInv1<Inv>(Inv()) - fooInv2<Inv>(Inv()) - fooInv1(Inv()) - fooInv2(Inv()) + fooInv1<Inv>(Inv()) + fooInv2<Inv>(Inv()) + fooInv1(Inv()) + fooInv2(Inv()) - fooIn1<In>(In()) - fooIn2<In>(In()) - fooIn1(In()) - fooIn2(In()) + fooIn1<In>(In()) + fooIn2<In>(In()) + fooIn1(In()) + fooIn2(In()) - fooOut1<Out>(Out()) + fooOut1<Out>(Out()) fooOut2>(Out()) - fooOut1(Out()) + fooOut1(Out()) fooOut2(Out()) } } diff --git a/compiler/testData/diagnostics/tests/generics/nullability/tpInBounds.kt b/compiler/testData/diagnostics/tests/generics/nullability/tpInBounds.kt index 2294e02915e..1990c56c330 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/tpInBounds.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/tpInBounds.kt @@ -24,13 +24,13 @@ class A { } if (1 == 1) { - t = tN + t = tN } - t = y + t = y if (y != null) { - t = y + t = y } if (tN != null) { diff --git a/compiler/testData/diagnostics/tests/generics/nullability/useAsReceiver.kt b/compiler/testData/diagnostics/tests/generics/nullability/useAsReceiver.kt index e3cba2c3ef7..14f8ee214e4 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/useAsReceiver.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/useAsReceiver.kt @@ -21,7 +21,7 @@ fun foo(x: T) { x?.bar1() x?.bar2() - x.bar3() + x.bar3() 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 7f16af75a96..2567d0a09f3 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/useAsValueArgument.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/useAsValueArgument.kt @@ -13,6 +13,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 145d8025b7f..8ee2dc801f5 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/addAll.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/addAll.kt @@ -15,18 +15,18 @@ fun mc(): MC = null!! fun c(): C = null!! fun foo(x: MC) { - x.addAll(; MC; MC; public abstract fun addAll\(x: C\): Boolean defined in MC)!>x) - x.addAllMC(; MC; MC; public abstract fun addAllMC\(x: MC\): Boolean defined in MC)!>x) + x.addAll(x) + x.addAllMC(x) - x.addAll(; MC; MC; public abstract fun addAll\(x: C\): Boolean defined in MC)!>mc()) - x.addAllMC(; MC; MC; public abstract fun addAllMC\(x: MC\): Boolean defined in MC)!>mc()) + x.addAll(mc()) + x.addAllMC(mc()) - x.addAll(; MC; MC; public abstract fun addAll\(x: C\): Boolean defined in MC)!>mc()) - x.addAllMC(; MC; MC; public abstract fun addAllMC\(x: MC\): Boolean defined in MC)!>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 2960cf6ee1d..a8ef0bc1f95 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/extensionReceiverTypeMismatch.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/extensionReceiverTypeMismatch.kt @@ -8,11 +8,11 @@ class Out fun test(x: A, y: Out) { with(x) { // TODO: this diagnostic could be replaced with TYPE_MISMATCH_DUE_TO_TYPE_PROJECTION - "".foo() - y.bar() + "".foo() + 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 373488c4532..deec48f3d5b 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/inValueParameter.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/inValueParameter.kt @@ -5,5 +5,5 @@ interface B { } fun foo(x: B, y: A) { - x.foo(y) + x.foo(y) } diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/kt7296.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/kt7296.kt index cc6e478e06a..99ba3fd5832 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/kt7296.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/kt7296.kt @@ -9,7 +9,7 @@ fun main(args : Array) { val a : ArrayList> = ArrayList() val b : ListOfLists = ListOfLists(a) val c : ListOfLists<*> = b - val d : ArrayList> = c.x + val d : ArrayList> = c.x c.x checkType { _>>() } } diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/multipleArgumentProjectedOut.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/multipleArgumentProjectedOut.kt index b9db4771da5..b007e3623e8 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/multipleArgumentProjectedOut.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/multipleArgumentProjectedOut.kt @@ -6,5 +6,5 @@ class A { } fun test(a: A) { - a.foo("", "") + a.foo("", "") } diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/platformSuperClass.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/platformSuperClass.kt index 63f2e9eb509..120b6e464be 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/platformSuperClass.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/platformSuperClass.kt @@ -10,10 +10,10 @@ public class Clazz { // FILE: main.kt fun test(clazz: Clazz<*>) { clazz.t checkType { _() } - clazz.getSuperClass() checkType { _?>() } + clazz.getSuperClass() checkType { _?>() } clazz.getSuperClass().t checkType { _() } - clazz.superClass checkType { _?>() } + clazz.superClass checkType { _?>() } clazz.superClass.t checkType { _() } // See KT-9294 diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/projectedOutConventions.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/projectedOutConventions.kt index 917a086b378..b3461fe40b9 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/projectedOutConventions.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/projectedOutConventions.kt @@ -8,7 +8,7 @@ class A { } fun test(a: A) { - a defined in 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 7f35dd08477..a9c1c6fa511 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/projectedOutSmartCast.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/projectedOutSmartCast.kt @@ -6,18 +6,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/starNullabilityRecursive.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/starNullabilityRecursive.kt index 7a5f0dc7fdd..cebe9e5b231 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/starNullabilityRecursive.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/starNullabilityRecursive.kt @@ -5,5 +5,5 @@ interface A?> { fun foo(): T? } fun testA(a: A<*>) { - a.foo() checkType { _?>() } + a.foo() checkType { _?>() } } diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/typeMismatchConventions.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/typeMismatchConventions.kt index 4a56a7cbfbf..16b8448b167 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/typeMismatchConventions.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/typeMismatchConventions.kt @@ -10,9 +10,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/typeMismatchInLambda.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/typeMismatchInLambda.kt index b03262c184d..a5af6b880ff 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/typeMismatchInLambda.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/typeMismatchInLambda.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 "") - "" + "" } } diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/typeParameterBounds.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/typeParameterBounds.kt index dde6e02ea3a..90794e1a9d5 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/typeParameterBounds.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/typeParameterBounds.kt @@ -13,15 +13,15 @@ class A { } fun foo2(a: A, b: A) { - a.foo1(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()) @@ -31,12 +31,12 @@ 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()) b.foo3<In>(In()) b.foo3(In()) diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/unsafeVarianceStar.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/unsafeVarianceStar.kt index 10f4635a1d4..facd768483e 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/unsafeVarianceStar.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/unsafeVarianceStar.kt @@ -5,6 +5,6 @@ interface A { } fun test(a: A<*>) { - a.foo(null) - a.foo(Any()) + a.foo(null) + a.foo(Any()) } diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/varargs.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/varargs.kt index 7a1cce87ec8..d5dfe3c9f6b 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/varargs.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/varargs.kt @@ -6,8 +6,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 dd447e7e163..cf29f51d3a9 100644 --- a/compiler/testData/diagnostics/tests/generics/starProjections/invalid.kt +++ b/compiler/testData/diagnostics/tests/generics/starProjections/invalid.kt @@ -13,11 +13,11 @@ class Inv2<T : Inv2>(val x: T) fun main(a: A<*>, j: JavaClass<*>, i2: Inv2<*>) { // Probably it's too restrictive to suppose star projection type here as Any?, // but looks like we can refine it later - a.foo() checkType { _() } - j.foo() checkType { _() } - i2.x checkType { _() } + a.foo() checkType { _() } + j.foo() checkType { _() } + i2.x checkType { _() } - j.bar(1, 2, Any()) + j.bar(1, 2, Any()) } // FILE: JavaClass.java diff --git a/compiler/testData/diagnostics/tests/generics/tpAsReified/CapturedAsReified.kt b/compiler/testData/diagnostics/tests/generics/tpAsReified/CapturedAsReified.kt index 7df95fbe8ed..71199d31867 100644 --- a/compiler/testData/diagnostics/tests/generics/tpAsReified/CapturedAsReified.kt +++ b/compiler/testData/diagnostics/tests/generics/tpAsReified/CapturedAsReified.kt @@ -5,5 +5,5 @@ class A inline fun foo(x: A) {} fun test(x: A) { - foo(x) + foo(x) } diff --git a/compiler/testData/diagnostics/tests/generics/tpAsReified/InConstructor.kt b/compiler/testData/diagnostics/tests/generics/tpAsReified/InConstructor.kt index 64e74e83ac8..33dce1700e1 100644 --- a/compiler/testData/diagnostics/tests/generics/tpAsReified/InConstructor.kt +++ b/compiler/testData/diagnostics/tests/generics/tpAsReified/InConstructor.kt @@ -4,7 +4,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 83586f9d836..52425e95571 100644 --- a/compiler/testData/diagnostics/tests/generics/tpAsReified/InFunction.kt +++ b/compiler/testData/diagnostics/tests/generics/tpAsReified/InFunction.kt @@ -6,13 +6,13 @@ inline fun f(): T = throw UnsupportedOperationException() fun id(p: T): T = p fun main() { - f() + f() - val a: A = f() - f<A>() + val a: A = f() + f<A>() - val b: Int = f() - f() + 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/generics/varProjection/setterNotProjectedOutAssign.kt b/compiler/testData/diagnostics/tests/generics/varProjection/setterNotProjectedOutAssign.kt index 4013acd1a59..14c58b8bce7 100644 --- a/compiler/testData/diagnostics/tests/generics/varProjection/setterNotProjectedOutAssign.kt +++ b/compiler/testData/diagnostics/tests/generics/varProjection/setterNotProjectedOutAssign.kt @@ -1,9 +1,10 @@ // !CHECK_TYPE +// !WITH_NEW_INFERENCE interface Tr { var v: Tr } fun test(t: Tr<*>) { - t.v = t + t.v = t t.v checkType { _>() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/generics/varProjection/setterProjectedOutAssign.kt b/compiler/testData/diagnostics/tests/generics/varProjection/setterProjectedOutAssign.kt index be7dcf38e55..93212e0bebc 100644 --- a/compiler/testData/diagnostics/tests/generics/varProjection/setterProjectedOutAssign.kt +++ b/compiler/testData/diagnostics/tests/generics/varProjection/setterProjectedOutAssign.kt @@ -1,5 +1,6 @@ // !DIAGNOSTICS: -UNREACHABLE_CODE -UNUSED_PARAMETER // !CHECK_TYPE +// !WITH_NEW_INFERENCE // t is unused due to KT-4233 interface Tr { var v: T @@ -7,7 +8,7 @@ interface Tr { fun test(t: Tr<*>) { t.v = null!! - t.v = "" - t.v = null + t.v = "" + t.v = null t.v checkType { _() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/generics/varProjection/setterProjectedOutNoPlusAssign.kt b/compiler/testData/diagnostics/tests/generics/varProjection/setterProjectedOutNoPlusAssign.kt index f1169423b91..373364973a8 100644 --- a/compiler/testData/diagnostics/tests/generics/varProjection/setterProjectedOutNoPlusAssign.kt +++ b/compiler/testData/diagnostics/tests/generics/varProjection/setterProjectedOutNoPlusAssign.kt @@ -1,4 +1,5 @@ // !DIAGNOSTICS: -UNREACHABLE_CODE +// !WITH_NEW_INFERENCE interface Tr { var v: T } @@ -6,5 +7,5 @@ interface Tr { fun test(t: Tr) { // resolved as t.v = t.v + null!!, where type of right operand is String, // so TYPE_MISMATCH: String is not <: of Captured(out String) - t.v += null!! + t.v += null!! } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/generics/wrongNumberOfTypeArgumentsDiagnostic.kt b/compiler/testData/diagnostics/tests/generics/wrongNumberOfTypeArgumentsDiagnostic.kt index 4a0b5e0b59b..6a9d801228a 100644 --- a/compiler/testData/diagnostics/tests/generics/wrongNumberOfTypeArgumentsDiagnostic.kt +++ b/compiler/testData/diagnostics/tests/generics/wrongNumberOfTypeArgumentsDiagnostic.kt @@ -5,12 +5,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 m1 = java.util.HashMap() - val m2 = java.util.HashMap() + val m0 = java.util.HashMap() + val m1 = java.util.HashMap() + val m2 = java.util.HashMap() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/implicitIntersection.kt b/compiler/testData/diagnostics/tests/implicitIntersection.kt index 767bb9d8f2d..a384839b6d7 100644 --- a/compiler/testData/diagnostics/tests/implicitIntersection.kt +++ b/compiler/testData/diagnostics/tests/implicitIntersection.kt @@ -5,24 +5,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() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/implicitNestedIntersection.kt b/compiler/testData/diagnostics/tests/implicitNestedIntersection.kt index ab22fd44757..6a5e9260584 100644 --- a/compiler/testData/diagnostics/tests/implicitNestedIntersection.kt +++ b/compiler/testData/diagnostics/tests/implicitNestedIntersection.kt @@ -7,4 +7,4 @@ open class B : In fun select(x: T, y: T) = x -fun foo2() = select(A(), B()) // Type is In is prohibited in return position +fun foo2() = select(A(), B()) // Type is In is prohibited in return position diff --git a/compiler/testData/diagnostics/tests/imports/ClassClashStarImport.kt b/compiler/testData/diagnostics/tests/imports/ClassClashStarImport.kt index 3995f1a3d6a..79c0bc89597 100644 --- a/compiler/testData/diagnostics/tests/imports/ClassClashStarImport.kt +++ b/compiler/testData/diagnostics/tests/imports/ClassClashStarImport.kt @@ -72,5 +72,5 @@ fun test(b: B) { b_3.m2() val b_4 = a.B() - b_4.m2() + b_4.m2() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/imports/Imports.kt b/compiler/testData/diagnostics/tests/imports/Imports.kt index 7eebbd7e862..9ae3f76b170 100644 --- a/compiler/testData/diagnostics/tests/imports/Imports.kt +++ b/compiler/testData/diagnostics/tests/imports/Imports.kt @@ -82,7 +82,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 8bda41d1e59..8366e50d48d 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/NoSenselessComparisonForErrorType.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/NoSenselessComparisonForErrorType.kt @@ -3,7 +3,7 @@ package a fun foo() { val a = getErrorType() - if (a == null) { //no senseless comparison + if (a == null) { //no senseless comparison } } \ 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 91d52676ab0..2ae7ece0c1d 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/arrayExpression.kt b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/arrayExpression.kt index 3913636d7a1..6094d93b1d6 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/arrayExpression.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/arrayExpression.kt @@ -4,5 +4,5 @@ package bar fun main(args : Array) { class Some - Some[] names = ["ads"] + Some[] names = ["ads"] } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/noTypeParamsInReturnType.kt b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/noTypeParamsInReturnType.kt index f9d78e58d58..000c4a3e735 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/incompleteCode/plusOnTheRight.kt b/compiler/testData/diagnostics/tests/incompleteCode/plusOnTheRight.kt index 105c52570db..03ecf31d505 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/plusOnTheRight.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/plusOnTheRight.kt @@ -7,5 +7,5 @@ class MyClass1 { } fun main(arg: MyClass1) { - arg+ + arg+ } diff --git a/compiler/testData/diagnostics/tests/incompleteCode/unresolvedArguments.kt b/compiler/testData/diagnostics/tests/incompleteCode/unresolvedArguments.kt index 4a75d5f5fd9..50d41b75596 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/unresolvedArguments.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/unresolvedArguments.kt @@ -8,6 +8,6 @@ fun bar(i: Int) {} fun bar(s: String) {} fun test() { - foo(rrr, 1) - bar(rrr) + foo(rrr, 1) + bar(rrr) } diff --git a/compiler/testData/diagnostics/tests/inference/NoInferenceFromDeclaredBounds.kt b/compiler/testData/diagnostics/tests/inference/NoInferenceFromDeclaredBounds.kt index edea397de01..579a0efd21c 100644 --- a/compiler/testData/diagnostics/tests/inference/NoInferenceFromDeclaredBounds.kt +++ b/compiler/testData/diagnostics/tests/inference/NoInferenceFromDeclaredBounds.kt @@ -4,7 +4,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 3570d05b2fd..1f1748f38e1 100644 --- a/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveAmbiguity.kt +++ b/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveAmbiguity.kt @@ -5,5 +5,5 @@ fun g(i: Int, a: Any): List 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 7612c3c1486..965935937bd 100644 --- a/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveFunctionLiteralsNoUse.kt +++ b/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveFunctionLiteralsNoUse.kt @@ -4,4 +4,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 7f8743b403c..c931bfe6635 100644 --- a/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveNoInfoForParameter.kt +++ b/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveNoInfoForParameter.kt @@ -5,7 +5,7 @@ fun f(i: Int, c: Collection 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 d7d76c38d74..d7f43c72444 100644 --- a/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveWithFunctionLiterals.kt +++ b/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveWithFunctionLiterals.kt @@ -5,7 +5,7 @@ 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 dabed9fa662..0fd1ed9274c 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/cannotCaptureInProjection.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/cannotCaptureInProjection.kt @@ -5,13 +5,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) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/captureForNullableTypes.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/captureForNullableTypes.kt index 1f1c83f0fbf..87da35a3390 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/captureForNullableTypes.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/captureForNullableTypes.kt @@ -5,15 +5,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 { _>>() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/captureFromNullableTypeVariable.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/captureFromNullableTypeVariable.kt index 591fda58129..e2e7f65b476 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/captureFromNullableTypeVariable.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/captureFromNullableTypeVariable.kt @@ -4,11 +4,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 { _>() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/captureTypeOnlyOnTopLevel.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/captureTypeOnlyOnTopLevel.kt index 5a52a01ca24..5851510be95 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/captureTypeOnlyOnTopLevel.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/captureTypeOnlyOnTopLevel.kt @@ -4,7 +4,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 8c0a76f4bdd..a7bc59387b6 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/expectedTypeMismatchWithInVariance.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/expectedTypeMismatchWithInVariance.kt @@ -5,6 +5,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 29c6181f528..c910b9956a2 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/kt2872.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/kt2872.kt @@ -3,5 +3,5 @@ fun Array.foo() {} fun test(array: Array) { array.foo() - array.foo<out Int>() + array.foo<out Int>() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/noCaptureTypeErrorForNonTopLevel.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/noCaptureTypeErrorForNonTopLevel.kt index 7f16b138834..07713c2abc0 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/noCaptureTypeErrorForNonTopLevel.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/noCaptureTypeErrorForNonTopLevel.kt @@ -11,8 +11,8 @@ fun bar(b: B>, bOut: B>, bOut2: B(b) - baz(bOut) - baz(bOut) + baz(bOut) + baz(bOut) baz(bOut2) baz(bOut2) diff --git a/compiler/testData/diagnostics/tests/inference/completeInferenceIfManyFailed.kt b/compiler/testData/diagnostics/tests/inference/completeInferenceIfManyFailed.kt index 48ac8d509d7..7f26973a7af 100644 --- a/compiler/testData/diagnostics/tests/inference/completeInferenceIfManyFailed.kt +++ b/compiler/testData/diagnostics/tests/inference/completeInferenceIfManyFailed.kt @@ -12,6 +12,6 @@ fun joinT(x: Comparable<*>, } fun test() { - val x2 = joinT(Unit, "2") + val x2 = joinT(Unit, "2") checkSubtype(x2) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/conflictingSubstitutions.kt b/compiler/testData/diagnostics/tests/inference/conflictingSubstitutions.kt index 40276d01a9e..aa8a7108ab6 100644 --- a/compiler/testData/diagnostics/tests/inference/conflictingSubstitutions.kt +++ b/compiler/testData/diagnostics/tests/inference/conflictingSubstitutions.kt @@ -8,9 +8,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/constraintOnFunctionLiteral.kt b/compiler/testData/diagnostics/tests/inference/constraints/constraintOnFunctionLiteral.kt index e8996f316a1..52ce5f62bd8 100644 --- a/compiler/testData/diagnostics/tests/inference/constraints/constraintOnFunctionLiteral.kt +++ b/compiler/testData/diagnostics/tests/inference/constraints/constraintOnFunctionLiteral.kt @@ -3,7 +3,7 @@ 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}) diff --git a/compiler/testData/diagnostics/tests/inference/constraints/ignoreConstraintFromImplicitInNothing.kt b/compiler/testData/diagnostics/tests/inference/constraints/ignoreConstraintFromImplicitInNothing.kt index 38b0c794753..ad3b012468d 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/kt6320.kt b/compiler/testData/diagnostics/tests/inference/constraints/kt6320.kt index 74eeb419295..b8db67946b0 100644 --- a/compiler/testData/diagnostics/tests/inference/constraints/kt6320.kt +++ b/compiler/testData/diagnostics/tests/inference/constraints/kt6320.kt @@ -16,6 +16,6 @@ class C class D(foo: C) { fun test(a: C) { - val d: D = D(a) + val d: D = D(a) } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/constraints/kt8879.kt b/compiler/testData/diagnostics/tests/inference/constraints/kt8879.kt index ec7b60abc35..8320858082a 100644 --- a/compiler/testData/diagnostics/tests/inference/constraints/kt8879.kt +++ b/compiler/testData/diagnostics/tests/inference/constraints/kt8879.kt @@ -9,5 +9,5 @@ fun > foo(klass: Inv): String? = null fun bar(): Inv = null!! fun test() { - foo(bar()) + foo(bar()) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/constraints/notNullConstraintOnNullableType.kt b/compiler/testData/diagnostics/tests/inference/constraints/notNullConstraintOnNullableType.kt index 15cfdf928a1..c8fab579ed8 100644 --- a/compiler/testData/diagnostics/tests/inference/constraints/notNullConstraintOnNullableType.kt +++ b/compiler/testData/diagnostics/tests/inference/constraints/notNullConstraintOnNullableType.kt @@ -18,8 +18,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 7adf98ab05d..7d80b88e614 100644 --- a/compiler/testData/diagnostics/tests/inference/dependantOnVariance.kt +++ b/compiler/testData/diagnostics/tests/inference/dependantOnVariance.kt @@ -14,38 +14,38 @@ fun readFromMyList(l: MyList, = getMyList(int) - val a1 : MyList = getMyList(any) + val a1 : MyList = getMyList(any) val a2 : MyList = getMyList(int) - val a3 : MyList = getMyListToReadFrom(int) + val a3 : MyList = getMyListToReadFrom(int) val a4 : MyList = getMyList(any) val a5 : MyList = getMyListToWriteTo(any) - val a6 : MyList = getMyList(int) + val a6 : MyList = getMyList(int) val a7 : MyList = getMyList(int) - val a8 : MyList = getMyListToReadFrom(int) - val a9 : MyList = getMyListToReadFrom(int) + val a8 : MyList = getMyListToReadFrom(int) + val a9 : MyList = getMyListToReadFrom(int) - val a10 : MyList = getMyList(any) - val a11 : MyList = getMyList(any) + val a10 : MyList = getMyList(any) + val a11 : MyList = getMyList(any) - val a12 : MyList = getMyListToWriteTo(any) - val a13 : MyList = getMyListToWriteTo(any) + val a12 : 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) @@ -54,14 +54,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 23c96b564e3..bcc0b4b930c 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 cfebb38723f..834a6bf8406 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 61409ea986c..6458645d350 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/expectedTypeWithGenerics.kt b/compiler/testData/diagnostics/tests/inference/expectedTypeWithGenerics.kt index a6f96a1857d..47361a50d17 100644 --- a/compiler/testData/diagnostics/tests/inference/expectedTypeWithGenerics.kt +++ b/compiler/testData/diagnostics/tests/inference/expectedTypeWithGenerics.kt @@ -12,7 +12,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 + val y2 = foo() as D } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/findViewById.kt b/compiler/testData/diagnostics/tests/inference/findViewById.kt index f6b623dc3c1..b7846fb0494 100644 --- a/compiler/testData/diagnostics/tests/inference/findViewById.kt +++ b/compiler/testData/diagnostics/tests/inference/findViewById.kt @@ -31,7 +31,7 @@ val xCastExplicitType = Test().findViewById(0) as X val xSafeCastExplicitType = Test().findViewById(0) as? X val yExplicit: Y = Test().findViewById(0) -val yCast = Test().findViewById(0) as Y +val yCast = Test().findViewById(0) as Y class TestChild : Test() { @@ -39,7 +39,7 @@ class TestChild : Test() { val xCast = findViewById(0) as X val yExplicit: Y = findViewById(0) - val yCast = findViewById(0) as Y + val yCast = findViewById(0) as Y } fun test(t: Test) { @@ -47,7 +47,7 @@ fun test(t: Test) { val xCast = t.findViewById(0) as X val yExplicit: Y = t.findViewById(0) - val yCast = t.findViewById(0) as Y + val yCast = t.findViewById(0) as Y } fun test2(t: Test?) { diff --git a/compiler/testData/diagnostics/tests/inference/fixationOrderForProperConstraints.kt b/compiler/testData/diagnostics/tests/inference/fixationOrderForProperConstraints.kt index 3680c8a8dc2..f01e2a987e7 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 }, "") \ No newline at end of file +fun test() = foo({ it + 1 }, { it.length }, "") \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/functionPlaceholderError.kt b/compiler/testData/diagnostics/tests/inference/functionPlaceholderError.kt index ad543a0cad3..0d8588abd95 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/implicitInvokeExtensionWithFunctionalArgument.kt b/compiler/testData/diagnostics/tests/inference/implicitInvokeExtensionWithFunctionalArgument.kt index a49f68b34e0..c4342b81eaf 100644 --- a/compiler/testData/diagnostics/tests/inference/implicitInvokeExtensionWithFunctionalArgument.kt +++ b/compiler/testData/diagnostics/tests/inference/implicitInvokeExtensionWithFunctionalArgument.kt @@ -23,7 +23,7 @@ fun test(s: SelectorFor): Double { d checkType { _>() } val e = s { return p1 } - e checkType { _>() } + e checkType { _>() } - return null!! + return null!! } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/implicitInvokeInCompanionObjectWithFunctionalArgument.kt b/compiler/testData/diagnostics/tests/inference/implicitInvokeInCompanionObjectWithFunctionalArgument.kt index 97ce5d18665..afa2ef853b2 100644 --- a/compiler/testData/diagnostics/tests/inference/implicitInvokeInCompanionObjectWithFunctionalArgument.kt +++ b/compiler/testData/diagnostics/tests/inference/implicitInvokeInCompanionObjectWithFunctionalArgument.kt @@ -13,5 +13,5 @@ fun test(s: String): String { a checkType { _() } val b = TestClass { return s } - b checkType { _() } + b checkType { _() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/implicitInvokeInObjectWithFunctionalArgument.kt b/compiler/testData/diagnostics/tests/inference/implicitInvokeInObjectWithFunctionalArgument.kt index f34d2b764c4..b666faecc06 100644 --- a/compiler/testData/diagnostics/tests/inference/implicitInvokeInObjectWithFunctionalArgument.kt +++ b/compiler/testData/diagnostics/tests/inference/implicitInvokeInObjectWithFunctionalArgument.kt @@ -11,5 +11,5 @@ fun test(s: String): String { a checkType { _() } val b = TestClass { return s } - b checkType { _() } + b checkType { _() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/implicitInvokeWithFunctionLiteralArgument.kt b/compiler/testData/diagnostics/tests/inference/implicitInvokeWithFunctionLiteralArgument.kt index 4543d049289..5d6bf1e3d34 100644 --- a/compiler/testData/diagnostics/tests/inference/implicitInvokeWithFunctionLiteralArgument.kt +++ b/compiler/testData/diagnostics/tests/inference/implicitInvokeWithFunctionLiteralArgument.kt @@ -8,7 +8,7 @@ class TestClass { fun test(value: T, test: TestClass): T { val x = test { return value } - x checkType { _() } + x checkType { _() } return value } diff --git a/compiler/testData/diagnostics/tests/inference/kt1293.kt b/compiler/testData/diagnostics/tests/inference/kt1293.kt index 6c43da67d12..c00fb5860c8 100644 --- a/compiler/testData/diagnostics/tests/inference/kt1293.kt +++ b/compiler/testData/diagnostics/tests/inference/kt1293.kt @@ -1,10 +1,11 @@ +// !WITH_NEW_INFERENCE //KT-1293 Kompiler doesn't show error when element of Array is assigned to Int package kt1293 fun main(args : Array) { val intArray = arrayOfNulls(10) - val i : Int = intArray[0] + val i : Int = intArray[0] requiresInt(intArray[0]) } diff --git a/compiler/testData/diagnostics/tests/inference/kt6175.kt b/compiler/testData/diagnostics/tests/inference/kt6175.kt index 319c9027ddd..2f03e3681df 100644 --- a/compiler/testData/diagnostics/tests/inference/kt6175.kt +++ b/compiler/testData/diagnostics/tests/inference/kt6175.kt @@ -4,46 +4,46 @@ fun foo(body: (R?) -> T): T = fail() fun test1() { - foo { - true - } - foo { x -> - true + foo { + true } + foo { x -> + true + } } fun bar(body: (R) -> T): T = fail() fun test2() { - bar { - true - } - bar { x -> - true + bar { + true } + bar { x -> + true + } } fun baz(body: (List) -> T): T = fail() fun test3() { - baz { - true - } - baz { x -> - true + baz { + true } + baz { x -> + true + } } fun brr(body: (List) -> T): T = fail() fun test4() { - brr { - true - } - brr { x -> - true + brr { + true } + brr { x -> + true + } } fun fail(): Nothing = throw Exception() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/lambdaInValInitializerWithAnonymousFunctions.kt b/compiler/testData/diagnostics/tests/inference/lambdaInValInitializerWithAnonymousFunctions.kt index b19b980a49b..31903b638ca 100644 --- a/compiler/testData/diagnostics/tests/inference/lambdaInValInitializerWithAnonymousFunctions.kt +++ b/compiler/testData/diagnostics/tests/inference/lambdaInValInitializerWithAnonymousFunctions.kt @@ -6,5 +6,5 @@ val test2f: suspend Any.() -> Unit = fun Any.() {} // This is a bug in the old inference and should be fixed in new inference // see "Fix anonymous function literals handling in type checker" for more deatils -val test3f: suspend Any.(Int) -> Int = fun (k: Int) = k + 1 -val test4f: SuspendFn = fun Any.() {} \ No newline at end of file +val test3f: suspend Any.(Int) -> Int = fun (k: Int) = k + 1 +val test4f: SuspendFn = fun Any.() {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/nestedCalls/binaryExpressions.kt b/compiler/testData/diagnostics/tests/inference/nestedCalls/binaryExpressions.kt index 3c6c09244f0..1d553689322 100644 --- a/compiler/testData/diagnostics/tests/inference/nestedCalls/binaryExpressions.kt +++ b/compiler/testData/diagnostics/tests/inference/nestedCalls/binaryExpressions.kt @@ -14,7 +14,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) @@ -24,19 +24,19 @@ fun test(z: Z) { operator fun Z.plus(a: A): A = a fun test1(z: Z) { - id(z + newA()) - val a: A = z + newA() - val b: A = z.plus(newA()) - val c: A = id(z + newA()) - val d: A = id(z.plus(newA())) - use(a, b, c, d) + id(z + newA()) + val a: A = z + newA() + val b: A = z.plus(newA()) + val c: A = id(z + newA()) + val d: A = id(z.plus(newA())) + use(a, b, c, d) } //comparison operation 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) } @@ -45,26 +45,26 @@ 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) + id(newA() in collection) } //boolean operations 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 8f92bcf2553..d225137851c 100644 --- a/compiler/testData/diagnostics/tests/inference/noInformationForParameter.kt +++ b/compiler/testData/diagnostics/tests/inference/noInformationForParameter.kt @@ -5,7 +5,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/possibleCycleOnConstraints.kt b/compiler/testData/diagnostics/tests/inference/possibleCycleOnConstraints.kt index 41725c17216..fe4495d62fe 100644 --- a/compiler/testData/diagnostics/tests/inference/possibleCycleOnConstraints.kt +++ b/compiler/testData/diagnostics/tests/inference/possibleCycleOnConstraints.kt @@ -7,8 +7,8 @@ fun g (f: () -> List) : T {x = g { Collections.emptyList() } + val x = g { Collections.emptyList() } - val y = g { Collections.emptyList() } - val z : List = g { Collections.emptyList() } + val y = g { Collections.emptyList() } + val z : List = g { Collections.emptyList() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/recursiveLocalFuns/localFactorial.kt b/compiler/testData/diagnostics/tests/inference/recursiveLocalFuns/localFactorial.kt index 42bdc16b623..6144b92cd5f 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/recursiveFun.kt b/compiler/testData/diagnostics/tests/inference/recursiveLocalFuns/recursiveFun.kt index cbab2f383cd..c8de63c917d 100644 --- a/compiler/testData/diagnostics/tests/inference/recursiveLocalFuns/recursiveFun.kt +++ b/compiler/testData/diagnostics/tests/inference/recursiveLocalFuns/recursiveFun.kt @@ -1,4 +1,4 @@ // !WITH_NEW_INFERENCE fun foo() { - fun bar() = (fun() = bar()) + fun bar() = (fun() = bar()) } diff --git a/compiler/testData/diagnostics/tests/inference/recursiveLocalFuns/recursiveLambda.kt b/compiler/testData/diagnostics/tests/inference/recursiveLocalFuns/recursiveLambda.kt index 671b014f84a..ab29170dd9a 100644 --- a/compiler/testData/diagnostics/tests/inference/recursiveLocalFuns/recursiveLambda.kt +++ b/compiler/testData/diagnostics/tests/inference/recursiveLocalFuns/recursiveLambda.kt @@ -1,6 +1,6 @@ // !WITH_NEW_INFERENCE fun foo() { fun bar() = { - bar() + bar() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/recursiveLocalFuns/selfCall.kt b/compiler/testData/diagnostics/tests/inference/recursiveLocalFuns/selfCall.kt index e19e142a5ed..029c77abb9d 100644 --- a/compiler/testData/diagnostics/tests/inference/recursiveLocalFuns/selfCall.kt +++ b/compiler/testData/diagnostics/tests/inference/recursiveLocalFuns/selfCall.kt @@ -1,9 +1,9 @@ // !WITH_NEW_INFERENCE fun foo() { - fun bar1() = bar1() + 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 426f4d27b42..6f355876936 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt1127.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt1127.kt @@ -6,5 +6,5 @@ package d fun asList(t: T) : List? {} fun main(args : Array) { - val list : List = asList("") + val list : List = asList("") } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2200.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2200.kt index c12dbaee9f2..c2f264b655f 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 fun main(args: Array) { - 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 15a8d3bd6d1..7ead3c4ae8b 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2283.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2283.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.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2286.kt index 83e1c50f69f..b3f2414cddd 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2286.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2286.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/kt2445.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2445.kt index 0b6f5fd0725..cca893ee9e0 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(args: Array) { - test { + test { } } diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2838.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2838.kt index 26bb1a1d789..871c61e5f5c 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2838.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2838.kt @@ -8,7 +8,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 41ff491b637..572ab5a249b 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2883.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2883.kt @@ -22,12 +22,12 @@ fun test() { doAction { bar(12) } - val u: Unit = bar(11) + val u: Unit = bar(11) } fun testWithoutInference(col: MutableCollection) { doAction { col.add(2) } - val u: Unit = col.add(2) + val u: Unit = col.add(2) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt731.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt731.kt index 6a401ead88e..d8cf7245936 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt731.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt731.kt @@ -13,7 +13,7 @@ fun A.foo(x: (T)-> G): G { } fun main(args: Array) { - val a = A(1) - val t: String = a.foo({p -> p}) + val a = A(1) + val t: String = a.foo({p -> p}) checkSubtype(t) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt742.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt742.kt index 15acaeaf16b..74f8f68504b 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt742.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt742.kt @@ -10,4 +10,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) \ No newline at end of file +fun List.map3(f: (T)-> Q): List? = tail.sure<T>().map3(f) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt832.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt832.kt index 91f7533fcad..ce50f71f86b 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt832.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt832.kt @@ -7,5 +7,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 } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt948.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt948.kt index 930d820ceec..8f55a0a7952 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt948.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt948.kt @@ -12,12 +12,12 @@ 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()) + checkSubtype>(emptyList()!!) + checkSubtype?>(emptyList()) - doWithList(emptyList()!!) + doWithList(emptyList()!!) } fun doWithList(list: List) = list \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/reportingImprovements/FunctionPlaceholder.kt b/compiler/testData/diagnostics/tests/inference/reportingImprovements/FunctionPlaceholder.kt index cfe752c3f8e..e1f885429db 100644 --- a/compiler/testData/diagnostics/tests/inference/reportingImprovements/FunctionPlaceholder.kt +++ b/compiler/testData/diagnostics/tests/inference/reportingImprovements/FunctionPlaceholder.kt @@ -7,11 +7,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} } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/reportingImprovements/cannotInferParameterTypeWithInference.kt b/compiler/testData/diagnostics/tests/inference/reportingImprovements/cannotInferParameterTypeWithInference.kt index b1c17d01828..6ba859b70fb 100644 --- a/compiler/testData/diagnostics/tests/inference/reportingImprovements/cannotInferParameterTypeWithInference.kt +++ b/compiler/testData/diagnostics/tests/inference/reportingImprovements/cannotInferParameterTypeWithInference.kt @@ -4,8 +4,8 @@ package aa fun foo(block: (T)-> R) = block fun test1() { - foo { - x -> // here we have 'cannot infer parameter type' error + foo { + x -> // here we have 'cannot infer parameter type' error 43 } } diff --git a/compiler/testData/diagnostics/tests/inference/reportingImprovements/subtypeForInvariantWithErrorGenerics.kt b/compiler/testData/diagnostics/tests/inference/reportingImprovements/subtypeForInvariantWithErrorGenerics.kt index de261ca2218..567a463e450 100644 --- a/compiler/testData/diagnostics/tests/inference/reportingImprovements/subtypeForInvariantWithErrorGenerics.kt +++ b/compiler/testData/diagnostics/tests/inference/reportingImprovements/subtypeForInvariantWithErrorGenerics.kt @@ -5,8 +5,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 2a691505f29..fd7632cc51e 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 4e69ae4d0cd..6775de48f48 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/reportingImprovements/wrongArgumentPassedToLocalExtensionFunction.kt b/compiler/testData/diagnostics/tests/inference/reportingImprovements/wrongArgumentPassedToLocalExtensionFunction.kt index b46e39f8f5b..b0f02ede1de 100644 --- a/compiler/testData/diagnostics/tests/inference/reportingImprovements/wrongArgumentPassedToLocalExtensionFunction.kt +++ b/compiler/testData/diagnostics/tests/inference/reportingImprovements/wrongArgumentPassedToLocalExtensionFunction.kt @@ -13,7 +13,7 @@ fun test(f: Runnable.(Int) -> Unit, runnable: Runnable) { fun Int.test(f: String.(Int) -> Unit) { f("", 0) - f("") + f("") with("") { f(0) f(0.0) diff --git a/compiler/testData/diagnostics/tests/inference/typeConstructorMismatch.kt b/compiler/testData/diagnostics/tests/inference/typeConstructorMismatch.kt index ca3c48be5c8..2857bd951f9 100644 --- a/compiler/testData/diagnostics/tests/inference/typeConstructorMismatch.kt +++ b/compiler/testData/diagnostics/tests/inference/typeConstructorMismatch.kt @@ -5,9 +5,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 28c83bc7ee3..bbcb9218d75 100644 --- a/compiler/testData/diagnostics/tests/inference/typeInferenceExpectedTypeMismatch.kt +++ b/compiler/testData/diagnostics/tests/inference/typeInferenceExpectedTypeMismatch.kt @@ -4,7 +4,7 @@ package typeInferenceExpectedTypeMismatch import java.util.* fun test() { - val s : Set = newList() + val s : Set = newList() use(s) } @@ -26,16 +26,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 f2609786760..890406fbb56 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() } //-------------- @@ -14,7 +14,7 @@ fun test1() { fun emptyListOfA(): List = throw Exception() fun test2() { - emptyListOfA() + emptyListOfA() } //-------------- @@ -22,7 +22,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 cfd29b84229..21a558161a9 100644 --- a/compiler/testData/diagnostics/tests/inference/upperBounds/intersectUpperBounds.kt +++ b/compiler/testData/diagnostics/tests/inference/upperBounds/intersectUpperBounds.kt @@ -13,7 +13,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/useBoundsIfUnknownParameters.kt b/compiler/testData/diagnostics/tests/inference/upperBounds/useBoundsIfUnknownParameters.kt index fb46c5cf4c5..1bb4b7d73a4 100644 --- a/compiler/testData/diagnostics/tests/inference/upperBounds/useBoundsIfUnknownParameters.kt +++ b/compiler/testData/diagnostics/tests/inference/upperBounds/useBoundsIfUnknownParameters.kt @@ -8,5 +8,5 @@ class Client>(x: X) fun test() { val c = Client(StringBase()) // Type inference fails here for T. - val i : Int = c + val i : Int = c } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/upperBounds/useBoundsToInferTypeParamsSimple.kt b/compiler/testData/diagnostics/tests/inference/upperBounds/useBoundsToInferTypeParamsSimple.kt index 89fc519d872..322568f2322 100644 --- a/compiler/testData/diagnostics/tests/inference/upperBounds/useBoundsToInferTypeParamsSimple.kt +++ b/compiler/testData/diagnostics/tests/inference/upperBounds/useBoundsToInferTypeParamsSimple.kt @@ -16,7 +16,7 @@ fun checkItIsExactlyAny(t: T, l 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 e6836d19a4c..6ff4b5e4432 100644 --- a/compiler/testData/diagnostics/tests/infos/SmartCasts.kt +++ b/compiler/testData/diagnostics/tests/infos/SmartCasts.kt @@ -149,7 +149,7 @@ fun illegalWhenBody(a: Any): Int = when(a) { fun illegalWhenBlock(a: Any): Int { when(a) { is Int -> return a - is String -> return a + is String -> return a } } fun declarations(a: Any?) { @@ -183,7 +183,7 @@ fun returnFunctionLiteral(a: Any?): Function0 { } fun returnFunctionLiteralExpressionBody(a: Any?): Function0 = - if (a is Int) { -> a } + if (a is Int) { -> a } else { -> 1 } @@ -202,7 +202,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 @@ -222,7 +222,7 @@ fun f(): String { fun foo(aa: Any?): Int { var a = aa if (a is Int?) { - return a + return a } return 1 } diff --git a/compiler/testData/diagnostics/tests/inline/inlineLambdaInDefaultInlineParameterDisabled.kt b/compiler/testData/diagnostics/tests/inline/inlineLambdaInDefaultInlineParameterDisabled.kt index 5b83f021a1d..90ae1b88905 100644 --- a/compiler/testData/diagnostics/tests/inline/inlineLambdaInDefaultInlineParameterDisabled.kt +++ b/compiler/testData/diagnostics/tests/inline/inlineLambdaInDefaultInlineParameterDisabled.kt @@ -7,7 +7,7 @@ inline fun inlineFun(lambda: () -> String) = lambda() fun noInlineFun(lambda: () -> String) = lambda() -inline fun default0_1(lambda: () -> String, dlambda: () -> String = { lambda }) { +inline fun default0_1(lambda: () -> String, dlambda: () -> String = { lambda }) { lambda() + dlambda() } diff --git a/compiler/testData/diagnostics/tests/inline/kt15410.kt b/compiler/testData/diagnostics/tests/inline/kt15410.kt index 1bfe158cd71..6ac63cf4457 100644 --- a/compiler/testData/diagnostics/tests/inline/kt15410.kt +++ b/compiler/testData/diagnostics/tests/inline/kt15410.kt @@ -6,5 +6,5 @@ open class Foo protected constructor() inline fun foo(f: () -> Unit) = object: Foo() {} class A : Foo() { - inline fun foo(f: () -> Unit) = Foo() + inline fun foo(f: () -> Unit) = Foo() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/genericNestedClass.kt b/compiler/testData/diagnostics/tests/inner/qualifiedExpression/genericNestedClass.kt index 7e6ac061307..178b3cd3473 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/collectorInference.kt b/compiler/testData/diagnostics/tests/j+k/collectorInference.kt index 75e51dc97ec..c5021a738fe 100644 --- a/compiler/testData/diagnostics/tests/j+k/collectorInference.kt +++ b/compiler/testData/diagnostics/tests/j+k/collectorInference.kt @@ -9,6 +9,6 @@ import java.util.stream.Stream fun test(a: Stream) { a.collect(Collectors.toList()) checkType { _>() } // actually the inferred type is platform - a.collect(Collectors.toList()) checkType { _>() } + a.collect(Collectors.toList()) checkType { _>() } } diff --git a/compiler/testData/diagnostics/tests/j+k/genericConstructor/classTypeParameterInferredFromArgument.kt b/compiler/testData/diagnostics/tests/j+k/genericConstructor/classTypeParameterInferredFromArgument.kt index 2688b25e95a..270f238b56b 100644 --- a/compiler/testData/diagnostics/tests/j+k/genericConstructor/classTypeParameterInferredFromArgument.kt +++ b/compiler/testData/diagnostics/tests/j+k/genericConstructor/classTypeParameterInferredFromArgument.kt @@ -9,9 +9,9 @@ public class A { // FILE: main.kt fun test(x: List, y: List) { - A("", x) checkType { _>() } - A("", y) checkType { _>() } + A("", x) checkType { _>() } + A("", y) checkType { _>() } - A("", x) + A("", x) A("", y) } diff --git a/compiler/testData/diagnostics/tests/j+k/genericConstructor/innerClass.kt b/compiler/testData/diagnostics/tests/j+k/genericConstructor/innerClass.kt index 9acafd1215f..405e1aa275c 100644 --- a/compiler/testData/diagnostics/tests/j+k/genericConstructor/innerClass.kt +++ b/compiler/testData/diagnostics/tests/j+k/genericConstructor/innerClass.kt @@ -13,6 +13,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) + 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 2cd18d7ac3a..e5f2645fb36 100644 --- a/compiler/testData/diagnostics/tests/j+k/genericConstructor/noClassTypeParametersInvParameter.kt +++ b/compiler/testData/diagnostics/tests/j+k/genericConstructor/noClassTypeParametersInvParameter.kt @@ -10,12 +10,12 @@ public class A { class Inv fun test(x: Inv, y: Inv) { - A("", x) + A("", x) A("", y) - A("", x) + A("", x) - A("", x) + A("", x) A("", y) A("", y) } diff --git a/compiler/testData/diagnostics/tests/j+k/genericConstructor/recursive.kt b/compiler/testData/diagnostics/tests/j+k/genericConstructor/recursive.kt index 177a474f651..1be2d3fb5a1 100644 --- a/compiler/testData/diagnostics/tests/j+k/genericConstructor/recursive.kt +++ b/compiler/testData/diagnostics/tests/j+k/genericConstructor/recursive.kt @@ -9,4 +9,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 5ef42c7edc7..fac99ec5df8 100644 --- a/compiler/testData/diagnostics/tests/j+k/genericConstructor/superCall.kt +++ b/compiler/testData/diagnostics/tests/j+k/genericConstructor/superCall.kt @@ -10,9 +10,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 ee56a7763f7..f092f6d8aeb 100644 --- a/compiler/testData/diagnostics/tests/j+k/genericConstructor/superCallImpossibleToInfer.kt +++ b/compiler/testData/diagnostics/tests/j+k/genericConstructor/superCallImpossibleToInfer.kt @@ -12,10 +12,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 0bbcf7c4093..7a807f41e85 100644 --- a/compiler/testData/diagnostics/tests/j+k/genericConstructorWithMultipleBounds.kt +++ b/compiler/testData/diagnostics/tests/j+k/genericConstructorWithMultipleBounds.kt @@ -11,8 +11,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 4ebb0fb6785..afcc28e4168 100644 --- a/compiler/testData/diagnostics/tests/j+k/sam/enhancedSamConstructor.kt +++ b/compiler/testData/diagnostics/tests/j+k/sam/enhancedSamConstructor.kt @@ -16,13 +16,13 @@ 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() } + J { null } + J { it?.length?.toString() } - J2 { s: String -> s} + J2 { s: String -> s} J2 { "" + it.length } - J2 { null } - J2 { it?.length?.toString() } + J2 { null } + J2 { it?.length?.toString() } } diff --git a/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericInReturnType.kt b/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericInReturnType.kt index 8b80c0f3d2c..d050d43e045 100644 --- a/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericInReturnType.kt +++ b/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericInReturnType.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/j+k/samByProjectedType/noAdapterBecuaseOfRecursiveUpperBound.kt b/compiler/testData/diagnostics/tests/j+k/samByProjectedType/noAdapterBecuaseOfRecursiveUpperBound.kt index bb93cb2923a..c0b62ef75f0 100644 --- a/compiler/testData/diagnostics/tests/j+k/samByProjectedType/noAdapterBecuaseOfRecursiveUpperBound.kt +++ b/compiler/testData/diagnostics/tests/j+k/samByProjectedType/noAdapterBecuaseOfRecursiveUpperBound.kt @@ -17,12 +17,12 @@ public class A { // FILE: main.kt fun main() { A().foo { - x -> + x -> "" } A.bar { - x -> + x -> "" } } diff --git a/compiler/testData/diagnostics/tests/j+k/wrongVarianceInJava.kt b/compiler/testData/diagnostics/tests/j+k/wrongVarianceInJava.kt index 280a4fa5a96..f1bfaa68674 100644 --- a/compiler/testData/diagnostics/tests/j+k/wrongVarianceInJava.kt +++ b/compiler/testData/diagnostics/tests/j+k/wrongVarianceInJava.kt @@ -20,5 +20,5 @@ class In { fun test() { A.foo().x() checkType { _() } - A.bar().y(null) + A.bar().y(null) } diff --git a/compiler/testData/diagnostics/tests/kt13401.kt b/compiler/testData/diagnostics/tests/kt13401.kt index b8aad251dbf..a04d73a0f3f 100644 --- a/compiler/testData/diagnostics/tests/kt13401.kt +++ b/compiler/testData/diagnostics/tests/kt13401.kt @@ -12,5 +12,5 @@ class Owner { fun getT() = u } - fun foo(arg: Inner<*>) = arg.getT() + fun foo(arg: Inner<*>) = arg.getT() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/kt310.kt b/compiler/testData/diagnostics/tests/kt310.kt index 57c2f43f97a..8ed71ce728f 100644 --- a/compiler/testData/diagnostics/tests/kt310.kt +++ b/compiler/testData/diagnostics/tests/kt310.kt @@ -1,3 +1,5 @@ +// !WITH_NEW_INFERENCE + fun f(c: LongRange): Int { - return c.start() + return c.start() } diff --git a/compiler/testData/diagnostics/tests/library/Collections.kt b/compiler/testData/diagnostics/tests/library/Collections.kt index 0cd0c7e695e..1592e16bab7 100644 --- a/compiler/testData/diagnostics/tests/library/Collections.kt +++ b/compiler/testData/diagnostics/tests/library/Collections.kt @@ -8,7 +8,7 @@ fun testCollection(c: Collection, t: T) { val iterator: Iterator = c.iterator() c.containsAll(c) - val mutableIterator: MutableIterator = c.iterator() + val mutableIterator: MutableIterator = c.iterator() c.add(t) c.remove(1) c.addAll(c) @@ -45,9 +45,9 @@ fun testList(l: List, t: T) { val value: T = l.set(1, t) l.add(1, t) l.remove(1) - val mutableListIterator: MutableListIterator = l.listIterator() - val mutableListIterator1: MutableListIterator = l.listIterator(1) - val mutableList: MutableList = l.subList(1, 2) + val mutableListIterator: MutableListIterator = l.listIterator() + val mutableListIterator1: MutableListIterator = l.listIterator(1) + val mutableList: MutableList = l.subList(1, 2) } fun testMutableList(l: MutableList, t: T) { @@ -66,7 +66,7 @@ fun testSet(s: Set, t: T) { val iterator: Iterator = s.iterator() s.containsAll(s) - val mutableIterator: MutableIterator = s.iterator() + val mutableIterator: MutableIterator = s.iterator() s.add(t) s.remove(1) s.addAll(s) @@ -97,9 +97,9 @@ fun testMap(m: Map) { val collection: Collection = m.values val set1: Set> = m.entries - val mutableSet: MutableSet = m.keys - val mutableCollection: MutableCollection = m.values - val mutableSet1: MutableSet> = m.entries + val mutableSet: MutableSet = m.keys + val mutableCollection: MutableCollection = m.values + val mutableSet1: MutableSet> = m.entries } fun testMutableMap(m: MutableMap) { diff --git a/compiler/testData/diagnostics/tests/modifiers/const/arrayInAnnotationArgumentType.kt b/compiler/testData/diagnostics/tests/modifiers/const/arrayInAnnotationArgumentType.kt index 6df01f635f1..234ee876117 100644 --- a/compiler/testData/diagnostics/tests/modifiers/const/arrayInAnnotationArgumentType.kt +++ b/compiler/testData/diagnostics/tests/modifiers/const/arrayInAnnotationArgumentType.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)) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/modifiers/operatorInfix/LocalFunctions.kt b/compiler/testData/diagnostics/tests/modifiers/operatorInfix/LocalFunctions.kt index a26337acbaf..c4fe083ba22 100644 --- a/compiler/testData/diagnostics/tests/modifiers/operatorInfix/LocalFunctions.kt +++ b/compiler/testData/diagnostics/tests/modifiers/operatorInfix/LocalFunctions.kt @@ -22,7 +22,7 @@ fun a() { val b = Example() consumeString(a + b) - consumeInt(a - b) + consumeInt(a - b) consumeString(a plus b) consumeInt(a minus b) diff --git a/compiler/testData/diagnostics/tests/modifiers/operatorInfix/MemberFunctions.kt b/compiler/testData/diagnostics/tests/modifiers/operatorInfix/MemberFunctions.kt index e172d621d8c..407ddbbd32d 100644 --- a/compiler/testData/diagnostics/tests/modifiers/operatorInfix/MemberFunctions.kt +++ b/compiler/testData/diagnostics/tests/modifiers/operatorInfix/MemberFunctions.kt @@ -20,7 +20,7 @@ fun a() { val b = Example() a + b - a - b + a - b a * b a / b @@ -31,7 +31,7 @@ fun a() { with (Example()) { consumeInt(this + a) - consumeString(this - b) + consumeString(this - b) consumeInt(this * a) consumeInt(this / b) diff --git a/compiler/testData/diagnostics/tests/modifiers/operatorInfix/Simple.kt b/compiler/testData/diagnostics/tests/modifiers/operatorInfix/Simple.kt index 87bc587a34d..8d8e23988a0 100644 --- a/compiler/testData/diagnostics/tests/modifiers/operatorInfix/Simple.kt +++ b/compiler/testData/diagnostics/tests/modifiers/operatorInfix/Simple.kt @@ -29,14 +29,14 @@ fun test() { var a = Example() val b = Example() - consumeString(a()) - consumeString(a[1]) + consumeString(a()) + consumeString(a[1]) - val (x, y) = Example() - consumeString(x) - consumeString(y) + val (x, y) = Example() + consumeString(x) + consumeString(y) - consumeExample2(++a) + consumeExample2(++a) consumeString(a plus b) } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/sameClassNameDifferentPackages.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/sameClassNameDifferentPackages.kt index bbbfcb18a17..6222bdb2084 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/sameClassNameDifferentPackages.kt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/sameClassNameDifferentPackages.kt @@ -18,5 +18,5 @@ import p.* class A fun test() { - val a: A = B().a + val a: A = B().a } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classVsFunctionGenericsInParamsMismatch.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classVsFunctionGenericsInParamsMismatch.kt index 1ef021675d6..4015a6f7b91 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classVsFunctionGenericsInParamsMismatch.kt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classVsFunctionGenericsInParamsMismatch.kt @@ -32,6 +32,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) } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/multiplatform/namedArguments.kt b/compiler/testData/diagnostics/tests/multiplatform/namedArguments.kt index de7447ec9ff..75d1e4b4dae 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/namedArguments.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/namedArguments.kt @@ -12,9 +12,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/multiplatform/topLevelFun/callableReferenceOnExpectFun.kt b/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/callableReferenceOnExpectFun.kt index 2c3ce8981b9..0acf67cc457 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/callableReferenceOnExpectFun.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/callableReferenceOnExpectFun.kt @@ -10,7 +10,7 @@ expect fun foo(): String fun g(f: () -> String): String = f() fun test() { - g(::foo) + g(::foo) } // MODULE: m2-jvm(m1-common) diff --git a/compiler/testData/diagnostics/tests/namedArguments/disallowForSamAdapterConstructor.kt b/compiler/testData/diagnostics/tests/namedArguments/disallowForSamAdapterConstructor.kt index 7ec20ec9c19..a66c092f403 100644 --- a/compiler/testData/diagnostics/tests/namedArguments/disallowForSamAdapterConstructor.kt +++ b/compiler/testData/diagnostics/tests/namedArguments/disallowForSamAdapterConstructor.kt @@ -13,5 +13,5 @@ public class J { package test fun test() { - J("", r = { }, z = false) + J("", r = { }, z = false) } diff --git a/compiler/testData/diagnostics/tests/namedArguments/disallowForSamAdapterFunction.kt b/compiler/testData/diagnostics/tests/namedArguments/disallowForSamAdapterFunction.kt index 5d9af118432..d50c2a49f28 100644 --- a/compiler/testData/diagnostics/tests/namedArguments/disallowForSamAdapterFunction.kt +++ b/compiler/testData/diagnostics/tests/namedArguments/disallowForSamAdapterFunction.kt @@ -13,5 +13,5 @@ public class J { package test fun test() { - J.foo("", r = { }, z = false) + J.foo("", r = { }, z = false) } diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/AssertNotNull.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/AssertNotNull.kt index 898d9f2be47..41a54e0d20b 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/AssertNotNull.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/AssertNotNull.kt @@ -35,5 +35,5 @@ fun main(args : Array) { } val f : String = a!! - checkSubtype(a!!) + checkSubtype(a!!) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/InfixCallNullability.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/InfixCallNullability.kt index 8762c3ab6f7..a865800f548 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/InfixCallNullability.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/InfixCallNullability.kt @@ -9,17 +9,17 @@ operator infix fun A.div(i : Int) {} operator infix fun A?.times(i : Int) {} fun test(x : Int?, a : A?) { - x.plus(1) + x.plus(1) x?.plus(1) - x + 1 + x + 1 -x x.unaryMinus() x?.unaryMinus() - a.plus(1) + a.plus(1) a?.plus(1) a plus 1 - a + 1 + a + 1 -a a.unaryMinus() a?.unaryMinus() diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2164.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2164.kt index 0dc64763155..948e0736611 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2164.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2164.kt @@ -23,8 +23,8 @@ fun main(args : Array) { foo(x) } else { foo(x) - foo(x!!) - foo(x) + foo(x!!) + foo(x) } foo(x) diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2216.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2216.kt index c26a3a8867e..0dda48f605e 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2216.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2216.kt @@ -15,8 +15,8 @@ fun foo() { val y: Int? = 0 val z: Int? = 0 - bar(if (y != null) y else z, y) - y + 2 + 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/nullabilityAndSmartCasts/unnecessaryNotNullAssertion.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/unnecessaryNotNullAssertion.kt index a1e9a09a30d..2791109960c 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/unnecessaryNotNullAssertion.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/unnecessaryNotNullAssertion.kt @@ -11,9 +11,9 @@ fun test() { takeNotNull(nullable()!!) var x: String? = null - takeNotNull(dependOn(x)!!) - takeNotNull(dependOn(dependOn(x))!!) - takeNotNull(dependOn(dependOn(x)!!)) + takeNotNull(dependOn(x)!!) + takeNotNull(dependOn(dependOn(x))!!) + takeNotNull(dependOn(dependOn(x)!!)) takeNotNull(dependOn(dependOn(x!!))) if (x != null) { diff --git a/compiler/testData/diagnostics/tests/nullableTypes/nullAssertOnTypeWithNullableUpperBound.kt b/compiler/testData/diagnostics/tests/nullableTypes/nullAssertOnTypeWithNullableUpperBound.kt index d8c27d1374f..f43cfd17581 100644 --- a/compiler/testData/diagnostics/tests/nullableTypes/nullAssertOnTypeWithNullableUpperBound.kt +++ b/compiler/testData/diagnostics/tests/nullableTypes/nullAssertOnTypeWithNullableUpperBound.kt @@ -10,6 +10,6 @@ fun T.testThis(): String { if (this != null) { return this!!.toString() } - return this!!.toString() + return this!!.toString() } diff --git a/compiler/testData/diagnostics/tests/nullableTypes/nullableArgumentToNonNullParameterPlatform.kt b/compiler/testData/diagnostics/tests/nullableTypes/nullableArgumentToNonNullParameterPlatform.kt index bec2e0777e5..d86c4a5d21d 100644 --- a/compiler/testData/diagnostics/tests/nullableTypes/nullableArgumentToNonNullParameterPlatform.kt +++ b/compiler/testData/diagnostics/tests/nullableTypes/nullableArgumentToNonNullParameterPlatform.kt @@ -13,6 +13,6 @@ public class J { fun test(j: J, nullStr: String?, nullByte: Byte?, nullDouble: Double?) { j.foo(nullStr) - j.foo(nullDouble) + j.foo(nullDouble) j.foo(nullByte) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/nullableTypes/nullableArgumentToNonNullParameterSimple.kt b/compiler/testData/diagnostics/tests/nullableTypes/nullableArgumentToNonNullParameterSimple.kt index 764767b9c16..bf2ef9f6c6a 100644 --- a/compiler/testData/diagnostics/tests/nullableTypes/nullableArgumentToNonNullParameterSimple.kt +++ b/compiler/testData/diagnostics/tests/nullableTypes/nullableArgumentToNonNullParameterSimple.kt @@ -6,7 +6,7 @@ fun foo(x: Int) {} fun foo(x: Int, y: String) {} fun bar(nullX: Int?, nullY: String?, notNullY: String) { - foo(nullX) + foo(nullX) foo(nullX, notNullY) foo(nullX, nullY) foo() diff --git a/compiler/testData/diagnostics/tests/nullableTypes/safeCallOnTypeWithNullableUpperBound.kt b/compiler/testData/diagnostics/tests/nullableTypes/safeCallOnTypeWithNullableUpperBound.kt index 73409b768d6..0476d26f7da 100644 --- a/compiler/testData/diagnostics/tests/nullableTypes/safeCallOnTypeWithNullableUpperBound.kt +++ b/compiler/testData/diagnostics/tests/nullableTypes/safeCallOnTypeWithNullableUpperBound.kt @@ -10,5 +10,5 @@ fun T.testThis(): String? { if (this != null) { return this?.toString() } - return this?.toString() + return this?.toString() } \ 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 0db7fc9ee8b..a896e6d9ab7 100644 --- a/compiler/testData/diagnostics/tests/nullableTypes/uselessElvis.kt +++ b/compiler/testData/diagnostics/tests/nullableTypes/uselessElvis.kt @@ -27,17 +27,17 @@ fun test() { takeNotNull(nullable() ?: "") val x: String? = null - takeNotNull(dependOn(x) ?: "") - takeNotNull(dependOn(dependOn(x)) ?: "") + takeNotNull(dependOn(x) ?: "") + takeNotNull(dependOn(dependOn(x)) ?: "") takeNotNull(dependOn(dependOn(x as String)) ?: "") if (x != null) { takeNotNull(dependOn(x) ?: "") takeNotNull(dependOn(dependOn(x)) ?: "") - takeNotNull(dependOn(dependOn(x) as? String) ?: "") + takeNotNull(dependOn(dependOn(x) as? String) ?: "") } - takeNotNull(bar()!!) + takeNotNull(bar()!!) } inline fun reifiedNull(): T? = null diff --git a/compiler/testData/diagnostics/tests/numbers/characterIsNotANumber.kt b/compiler/testData/diagnostics/tests/numbers/characterIsNotANumber.kt index d20648a9cce..c91e751e401 100644 --- a/compiler/testData/diagnostics/tests/numbers/characterIsNotANumber.kt +++ b/compiler/testData/diagnostics/tests/numbers/characterIsNotANumber.kt @@ -8,5 +8,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 400dacdc811..9c46e5d5ea8 100644 --- a/compiler/testData/diagnostics/tests/numbers/doublesInSimpleConstraints.kt +++ b/compiler/testData/diagnostics/tests/numbers/doublesInSimpleConstraints.kt @@ -19,5 +19,5 @@ fun test() { val d = either(11, 2.3) checkSubtype(d) - val e: Float = id(1) + val e: Float = id(1) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/numbers/intValuesOutOfRange.kt b/compiler/testData/diagnostics/tests/numbers/intValuesOutOfRange.kt index e0041f7e27b..6b22a625044 100644 --- a/compiler/testData/diagnostics/tests/numbers/intValuesOutOfRange.kt +++ b/compiler/testData/diagnostics/tests/numbers/intValuesOutOfRange.kt @@ -13,5 +13,5 @@ fun main(args: Array) { //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 852853e8715..2345cc10d42 100644 --- a/compiler/testData/diagnostics/tests/numbers/numbersInSimpleConstraints.kt +++ b/compiler/testData/diagnostics/tests/numbers/numbersInSimpleConstraints.kt @@ -13,9 +13,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) @@ -25,14 +25,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) } @@ -44,7 +44,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) @@ -57,7 +57,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 { _() } @@ -68,7 +68,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/objects/kt5527.kt b/compiler/testData/diagnostics/tests/objects/kt5527.kt index 0a8853e73f2..7a91f73e041 100644 --- a/compiler/testData/diagnostics/tests/objects/kt5527.kt +++ b/compiler/testData/diagnostics/tests/objects/kt5527.kt @@ -7,13 +7,13 @@ class A { } fun foo() { - val i1: Int = Boo - val i2: Int = A.Boo + val i1: Int = Boo + val i2: Int = A.Boo useInt(Boo) useInt(A.Boo) } fun bar() { - val i1: Int = Unit + val i1: Int = Unit useInt(Unit) } diff --git a/compiler/testData/diagnostics/tests/operatorRem/DeprecatedModAssignOperatorConventions.kt b/compiler/testData/diagnostics/tests/operatorRem/DeprecatedModAssignOperatorConventions.kt index 52b922f5483..e4e261566c7 100644 --- a/compiler/testData/diagnostics/tests/operatorRem/DeprecatedModAssignOperatorConventions.kt +++ b/compiler/testData/diagnostics/tests/operatorRem/DeprecatedModAssignOperatorConventions.kt @@ -29,7 +29,7 @@ fun test() { oldAndNew %= 1 val onlyOld = OnlyOld() - onlyOld %= 1 + onlyOld %= 1 val onlyNew = OnlyNew() onlyNew %= 1 diff --git a/compiler/testData/diagnostics/tests/operatorRem/DeprecatedModOperatorConventions.kt b/compiler/testData/diagnostics/tests/operatorRem/DeprecatedModOperatorConventions.kt index 5d82830f2f8..6121e479c2b 100644 --- a/compiler/testData/diagnostics/tests/operatorRem/DeprecatedModOperatorConventions.kt +++ b/compiler/testData/diagnostics/tests/operatorRem/DeprecatedModOperatorConventions.kt @@ -26,7 +26,7 @@ class IntAndUnit { fun test() { OldAndNew() % 1 - OnlyOld() % 1 + OnlyOld() % 1 OnlyNew() % 1 Sample() % 1 diff --git a/compiler/testData/diagnostics/tests/operatorRem/doNotResolveToInapplicableRem.kt b/compiler/testData/diagnostics/tests/operatorRem/doNotResolveToInapplicableRem.kt index c15b65b2f9d..23470239e12 100644 --- a/compiler/testData/diagnostics/tests/operatorRem/doNotResolveToInapplicableRem.kt +++ b/compiler/testData/diagnostics/tests/operatorRem/doNotResolveToInapplicableRem.kt @@ -9,5 +9,5 @@ object RemExtension operator fun RemExtension.rem(x: Int) {} fun foo() { - OldMod % 123 + OldMod % 123 } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/operatorRem/noWarningForModFromBuiltinsWhenApi1_0.kt b/compiler/testData/diagnostics/tests/operatorRem/noWarningForModFromBuiltinsWhenApi1_0.kt index 43e062bd32d..69e155445d6 100644 --- a/compiler/testData/diagnostics/tests/operatorRem/noWarningForModFromBuiltinsWhenApi1_0.kt +++ b/compiler/testData/diagnostics/tests/operatorRem/noWarningForModFromBuiltinsWhenApi1_0.kt @@ -28,9 +28,9 @@ class WithMod { operator fun mod(other: WithMod) = this fun test() { - val a = this % this + val a = this % this var b = this.mod(this) - b %= this + b %= this } } @@ -40,8 +40,8 @@ fun noOverflow() { fun builtIns(b: Byte, s: Short) { var a = 1 % 2 - a %= 3 + a %= 3 1.mod(2) - b % s - 1.0 % 2.0 + b % s + 1.0 % 2.0 } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/operatorsOverloading/kt13330.kt b/compiler/testData/diagnostics/tests/operatorsOverloading/kt13330.kt index dc57494539c..1a955bc1ad0 100644 --- a/compiler/testData/diagnostics/tests/operatorsOverloading/kt13330.kt +++ b/compiler/testData/diagnostics/tests/operatorsOverloading/kt13330.kt @@ -1,4 +1,4 @@ // !WITH_NEW_INFERENCE //KT-13330 AssertionError: Illegal resolved call to variable with invoke -fun foo(exec: (String.() -> Unit)?) = "".exec<caret>() // is test data tag here \ No newline at end of file +fun foo(exec: (String.() -> Unit)?) = "".exec<caret>() // is test data tag here \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/overload/defaultParameters.kt b/compiler/testData/diagnostics/tests/overload/defaultParameters.kt index abc3d7231bc..a3ef5a4614c 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/overload/kt2493.kt b/compiler/testData/diagnostics/tests/overload/kt2493.kt index 187278e22bd..c9c2ba17554 100644 --- a/compiler/testData/diagnostics/tests/overload/kt2493.kt +++ b/compiler/testData/diagnostics/tests/overload/kt2493.kt @@ -16,5 +16,5 @@ class C: A, B fun main(args: Array) { AImpl().f() BImpl().f() - C().f() + C().f() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/withNothing.kt b/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/withNothing.kt index de6e0d75a39..999fc892fe6 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 { _>() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/singleton.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/singleton.kt index c395d100d1c..0b3a5adc06d 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/singleton.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/methodCall/singleton.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!!) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/notNullTypeParameter/methodTypeParameter.kt b/compiler/testData/diagnostics/tests/platformTypes/notNullTypeParameter/methodTypeParameter.kt index fc5798e3cea..2ee0161e1da 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/notNullTypeParameter/methodTypeParameter.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/notNullTypeParameter/methodTypeParameter.kt @@ -11,9 +11,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.bar(null, A.platformString()) } diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/arithmetic.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/arithmetic.kt index f48c9f24eed..5762b49cb30 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/arithmetic.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/arithmetic.kt @@ -34,15 +34,15 @@ fun test() { platformJ++ 1 + platformNN - 1 + platformN + 1 + platformN 1 + platformJ platformNN + 1 - platformN + 1 + platformN + 1 platformJ + 1 1 plus platformNN - 1 plus platformN + 1 plus platformN 1 plus platformJ platformNN plus 1 @@ -50,6 +50,6 @@ fun test() { platformJ plus 1 platformNN += 1 - platformN += 1 + platformN += 1 platformJ += 1 } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/assignToVar.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/assignToVar.kt index bcc125ee286..af8ca09962a 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/assignToVar.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/assignToVar.kt @@ -18,7 +18,7 @@ var n: J? = J() fun test() { v = J.staticNN - v = J.staticN + v = J.staticN v = J.staticJ n = J.staticNN diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/conditions.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/conditions.kt index cda8720e916..f85f0a4ab7d 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/conditions.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/conditions.kt @@ -23,23 +23,23 @@ fun test() { val platformJ = J.staticJ if (platformNN) {} - if (platformN) {} + if (platformN) {} if (platformJ) {} while (platformNN) {} - while (platformN) {} + while (platformN) {} while (platformJ) {} do {} while (platformNN) - do {} while (platformN) + do {} while (platformN) do {} while (platformJ) platformNN && false - platformN && false + platformN && false platformJ && false platformNN || false - platformN || false + platformN || false platformJ || false !platformNN diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/dataFlowInfo.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/dataFlowInfo.kt index 8af77c1813a..95185820c8c 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/dataFlowInfo.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/dataFlowInfo.kt @@ -16,14 +16,14 @@ public class J { fun test() { val n = J.staticN foo(n) - J.staticNN = n + J.staticNN = n if (n != null) { foo(n) J.staticNN = n } val x: J? = null - J.staticNN = x + J.staticNN = x if (x != null) { J.staticNN = x } diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/defaultParameters.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/defaultParameters.kt index 6d74135a4b6..4fcd0a226e3 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/defaultParameters.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/defaultParameters.kt @@ -22,7 +22,7 @@ fun test() { // platform type with no annotation val platformJ = J.staticJ - fun foo(p: J = platformNN, p1: J = platformN, p2: J = platformJ) {} + fun foo(p: J = platformNN, p1: J = platformN, p2: J = platformJ) {} fun foo1(p: J? = platformNN, p1: J? = platformN, p2: J? = platformJ) {} } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/delegation.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/delegation.kt index 6b878d86363..9d1d64943ff 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/delegation.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/delegation.kt @@ -15,5 +15,5 @@ public class J { // FILE: k.kt class A : List by J.staticNN -class B : List by J.staticN +class B : List by J.staticN class C : List by J.staticJ \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/invoke.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/invoke.kt index 618110170a7..f7ba81e509c 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/invoke.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/invoke.kt @@ -19,6 +19,6 @@ public class J { fun test() { J.staticNN() - J.staticN() + J.staticN() J.staticJ() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/passToJava.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/passToJava.kt index c2367edb4df..f24b25d06b2 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/passToJava.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/passToJava.kt @@ -34,8 +34,8 @@ fun test(n: J?, nn: J) { // platform type with no annotation val platformJ = J.staticJ - J.staticNN = n - J.staticNN = platformN + J.staticNN = n + J.staticNN = platformN J.staticNN = nn J.staticNN = platformNN J.staticNN = platformJ @@ -58,8 +58,8 @@ fun test(n: J?, nn: J) { J.staticSet(platformN, platformN, platformN) J.staticSet(platformJ, platformJ, platformJ) - J().nn = n - J().nn = platformN + J().nn = n + J().nn = platformN J().nn = nn J().nn = platformNN J().nn = platformJ diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/throw.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/throw.kt index 87f626a5219..3c9cf3d9fb7 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/throw.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/throw.kt @@ -18,7 +18,7 @@ fun test() { } fun test1() { - throw J.staticN + throw J.staticN } fun test2() { diff --git a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/arrays.kt b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/arrays.kt index 0aef2d571dc..5b34f9874cf 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/arrays.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/arrays.kt @@ -28,15 +28,15 @@ fun main() { val raw = Test.rawAField raw.charSequences = arrayOf() - raw.charSequences = arrayOf() + raw.charSequences = arrayOf() raw.maps = arrayOf>() raw.maps = arrayOf>() - raw.maps = arrayOf>() + raw.maps = arrayOf>() raw.arraysOfLists = arrayOf>>() - raw.arraysOfLists = arrayOf>() - raw.arraysOfLists = arrayOf>>() + raw.arraysOfLists = arrayOf>() + raw.arraysOfLists = arrayOf>>() raw.arraysOfAny = arrayOf>>() diff --git a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/cantBeInferred.kt b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/cantBeInferred.kt index bb579888fe8..1cd14e50c42 100644 --- a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/cantBeInferred.kt +++ b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/cantBeInferred.kt @@ -1,6 +1,6 @@ // !WITH_NEW_INFERENCE -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/nullAsNothing.kt b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/nullAsNothing.kt index c8bd54ea24f..733b649e084 100644 --- a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/nullAsNothing.kt +++ b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/nullAsNothing.kt @@ -5,5 +5,5 @@ val y get() = null!! fun foo() { x checkType { _() } - y checkType { _() } + y checkType { _() } } diff --git a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/objectExpression.kt b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/objectExpression.kt index bd0b42a0fec..7726b324b40 100644 --- a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/objectExpression.kt +++ b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/objectExpression.kt @@ -7,7 +7,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 c5c6ebc76fb..a54d8c794c3 100644 --- a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/recursiveGetter.kt +++ b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/recursiveGetter.kt @@ -1,16 +1,16 @@ // !WITH_NEW_INFERENCE // !CHECK_TYPE -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 3ceb84e4e03..a32bc54fe4f 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/calleeExpressionAsCallExpression.kt b/compiler/testData/diagnostics/tests/qualifiedExpression/calleeExpressionAsCallExpression.kt index 31bea1ed20a..6b1b3e45daf 100644 --- a/compiler/testData/diagnostics/tests/qualifiedExpression/calleeExpressionAsCallExpression.kt +++ b/compiler/testData/diagnostics/tests/qualifiedExpression/calleeExpressionAsCallExpression.kt @@ -1,2 +1,2 @@ // !WITH_NEW_INFERENCE -val unwrapped = some<sdf()()Any>::unwrap \ No newline at end of file +val unwrapped = some<sdf()()Any>::unwrap \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/recovery/absentLeftHandSide.kt b/compiler/testData/diagnostics/tests/recovery/absentLeftHandSide.kt index 0d9a2300de3..0149c20db43 100644 --- a/compiler/testData/diagnostics/tests/recovery/absentLeftHandSide.kt +++ b/compiler/testData/diagnostics/tests/recovery/absentLeftHandSide.kt @@ -4,13 +4,13 @@ fun import() { } fun composite() { - val s = 13+~/12 + val s = 13+~/12 } fun html() { - <html></html> + <html></html> } fun html1() { - <html></html>html + <html></html>html } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/regressions/Jet81.kt b/compiler/testData/diagnostics/tests/regressions/Jet81.kt index 937280e5047..fdefbec0963 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; @@ -23,6 +23,6 @@ class Test2 { val y = 1 } - val b = a.x + val b = a.x val c = a.y } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/regressions/OutProjections.kt b/compiler/testData/diagnostics/tests/regressions/OutProjections.kt index 39efd74e639..b7a94fe10b1 100644 --- a/compiler/testData/diagnostics/tests/regressions/OutProjections.kt +++ b/compiler/testData/diagnostics/tests/regressions/OutProjections.kt @@ -9,7 +9,7 @@ fun f(expression : T) : G = G() fun foo() : G { val p = Point() - return f(p) + return f(p) } class Out() {} @@ -18,5 +18,5 @@ fun fout(expression : T) : Out< { val p = Point(); - return fout(p); + return fout(p); } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/regressions/TypeMismatchOnUnaryOperations.kt b/compiler/testData/diagnostics/tests/regressions/TypeMismatchOnUnaryOperations.kt index a9b122a049b..736e875327e 100644 --- a/compiler/testData/diagnostics/tests/regressions/TypeMismatchOnUnaryOperations.kt +++ b/compiler/testData/diagnostics/tests/regressions/TypeMismatchOnUnaryOperations.kt @@ -2,7 +2,7 @@ fun main(args : Array) { val a : Int? = null; var v = 1 - val b : String = v; + val b : String = v; val f : String = a!!; val g : String = v++; val g1 : String = ++v; diff --git a/compiler/testData/diagnostics/tests/regressions/correctResultSubstitutorForErrorCandidate.kt b/compiler/testData/diagnostics/tests/regressions/correctResultSubstitutorForErrorCandidate.kt index c66f2d28002..415aa2a661d 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/ea72837.kt b/compiler/testData/diagnostics/tests/regressions/ea72837.kt index 1c2ff7dd647..aa0263febd1 100644 --- a/compiler/testData/diagnostics/tests/regressions/ea72837.kt +++ b/compiler/testData/diagnostics/tests/regressions/ea72837.kt @@ -4,7 +4,7 @@ fun g(x: T) = 1 fun h(x: () -> Unit) = 1 fun foo() { - f(::) - g(::) - h(::) + f(::) + g(::) + h(::) } diff --git a/compiler/testData/diagnostics/tests/regressions/itselfAsUpperBoundLocal.kt b/compiler/testData/diagnostics/tests/regressions/itselfAsUpperBoundLocal.kt index 9fd1623003c..e4642fcac06 100644 --- a/compiler/testData/diagnostics/tests/regressions/itselfAsUpperBoundLocal.kt +++ b/compiler/testData/diagnostics/tests/regressions/itselfAsUpperBoundLocal.kt @@ -1,5 +1,5 @@ // !WITH_NEW_INFERENCE 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 6ab2a6061de..6aa663ce675 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt10243.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt10243.kt @@ -4,7 +4,7 @@ private fun doUpdateRegularTasks() { try { while (f) { val xmlText = getText() - if (xmlText == null) {} + if (xmlText == null) {} else { xmlText.value = 0 // !!! } diff --git a/compiler/testData/diagnostics/tests/regressions/kt10843.kt b/compiler/testData/diagnostics/tests/regressions/kt10843.kt index d4d1cd35329..9c13196cef7 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt10843.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt10843.kt @@ -1,7 +1,7 @@ // !WITH_NEW_INFERENCE // See EA-76890 / KT-10843: NPE during analysis -fun lambda(x : Int?) = x?.let l { - y -> - if (y > 0) return@l x - y +fun lambda(x : Int?) = x?.let l { + y -> + if (y > 0) return@l x + y }!! diff --git a/compiler/testData/diagnostics/tests/regressions/kt13685.kt b/compiler/testData/diagnostics/tests/regressions/kt13685.kt index 3e161815ad4..3d3772577f7 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt13685.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt13685.kt @@ -2,6 +2,6 @@ // !DIAGNOSTICS: -UNREACHABLE_CODE fun foo() { - val text: List = null!! + val text: List = null!! 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 9a69afe4825..4d5835e75ac 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt1489_1728.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt1489_1728.kt @@ -19,7 +19,7 @@ class C { fun p() : Resource? = null fun bar() { - foo(p()) { + foo(p()) { } } diff --git a/compiler/testData/diagnostics/tests/regressions/kt251.kt b/compiler/testData/diagnostics/tests/regressions/kt251.kt index b52bd7e1792..c8c8e171185 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt251.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt251.kt @@ -3,7 +3,7 @@ class A() { var x: Int = 0 get() = "s" set(value: String) { - field = value + field = value } val y: Int get(): String = "s" @@ -28,7 +28,7 @@ class A() { } val e = 1 get(): String { - return field + return field } } diff --git a/compiler/testData/diagnostics/tests/regressions/kt282.kt b/compiler/testData/diagnostics/tests/regressions/kt282.kt index add5982d012..534cd59c739 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt282.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt282.kt @@ -12,8 +12,8 @@ operator fun Int?.contains(x : Int) : Boolean = false fun f(): Unit { var set : Set? = null val i : Int? = null - i + 1 + i + 1 set + 1 - 1 in set + 1 in set 1 in 2 } diff --git a/compiler/testData/diagnostics/tests/regressions/kt312.kt b/compiler/testData/diagnostics/tests/regressions/kt312.kt index 7bf636b1c7f..8985a69a3a6 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt312.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt312.kt @@ -6,5 +6,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) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/regressions/kt328.kt b/compiler/testData/diagnostics/tests/regressions/kt328.kt index 48cb0eb0fe4..14b6a7e1f93 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt328.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt328.kt @@ -2,28 +2,28 @@ //KT-328 Local function in function literals cause exceptions fun bar1() = { - bar1() + bar1() } fun bar2() = { - fun foo2() = bar2() + fun foo2() = 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() } +fun foo3() = block{ bar3() } diff --git a/compiler/testData/diagnostics/tests/regressions/kt352.kt b/compiler/testData/diagnostics/tests/regressions/kt352.kt index 5bd249c75ea..89d65292cba 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt352.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt352.kt @@ -15,7 +15,7 @@ class A() { //more tests val g : () -> Unit = { 42 } -val gFunction : () -> Unit = fun(): Int = 1 +val gFunction : () -> Unit = fun(): Int = 1 val h : () -> Unit = { doSmth() } diff --git a/compiler/testData/diagnostics/tests/regressions/kt353.kt b/compiler/testData/diagnostics/tests/regressions/kt353.kt index 3eaa1217404..06ea7a09d8d 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt353.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt353.kt @@ -13,7 +13,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 = { @@ -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/regressions/kt5362.kt b/compiler/testData/diagnostics/tests/regressions/kt5362.kt index 34fbca34c61..e6a694f5a77 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt5362.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt5362.kt @@ -12,7 +12,7 @@ class Outer { fun Activity.toast() = Unit class Activity(){ class Fragment{ - fun call() = toast() + fun call() = toast() } } @@ -25,7 +25,7 @@ public class Manager { class Task(val callback: Manager.() -> Unit) : Runnable { override public fun run() { - callback() // Manager is not accessible here, but no error is shown + callback() // Manager is not accessible here, but no error is shown } } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/regressions/kt557.kt b/compiler/testData/diagnostics/tests/regressions/kt557.kt index ca81985dbb2..b36e017f0da 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt557.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt557.kt @@ -8,5 +8,5 @@ fun Array.length() : Int { } fun test(array : Array?) { - array?.sure>().length() + array?.sure>().length() } diff --git a/compiler/testData/diagnostics/tests/regressions/kt7804.kt b/compiler/testData/diagnostics/tests/regressions/kt7804.kt index 272a5ff8555..fcb08117fb7 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt7804.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt7804.kt @@ -12,7 +12,7 @@ fun test(v: T): T { v } - val t: T = a + val t: T = a return t } @@ -36,7 +36,7 @@ fun test3(v: T): T { v } - val t: T = a + val t: T = a return t } diff --git a/compiler/testData/diagnostics/tests/resolve/dslMarker/dslMarkerWithTypealiasRecursion.kt b/compiler/testData/diagnostics/tests/resolve/dslMarker/dslMarkerWithTypealiasRecursion.kt index 7a86989c69d..910df4bddb2 100644 --- a/compiler/testData/diagnostics/tests/resolve/dslMarker/dslMarkerWithTypealiasRecursion.kt +++ b/compiler/testData/diagnostics/tests/resolve/dslMarker/dslMarkerWithTypealiasRecursion.kt @@ -12,7 +12,7 @@ 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 { diff --git a/compiler/testData/diagnostics/tests/resolve/dslMarker/markersIntersection.kt b/compiler/testData/diagnostics/tests/resolve/dslMarker/markersIntersection.kt index 775a0300d13..d3c5eff2170 100644 --- a/compiler/testData/diagnostics/tests/resolve/dslMarker/markersIntersection.kt +++ b/compiler/testData/diagnostics/tests/resolve/dslMarker/markersIntersection.kt @@ -60,7 +60,7 @@ fun test() { bar1t(this) { a() bar1 { - a() + a() b() } @@ -76,7 +76,7 @@ fun test() { foo2 { bar1t(this) { a() - b() + b() } } } diff --git a/compiler/testData/diagnostics/tests/resolve/dslMarker/substitutedReceiverAnnotatedType.kt b/compiler/testData/diagnostics/tests/resolve/dslMarker/substitutedReceiverAnnotatedType.kt index d65adb64d78..b8e3754e133 100644 --- a/compiler/testData/diagnostics/tests/resolve/dslMarker/substitutedReceiverAnnotatedType.kt +++ b/compiler/testData/diagnostics/tests/resolve/dslMarker/substitutedReceiverAnnotatedType.kt @@ -19,7 +19,7 @@ fun test() { foo { a() bar { - a() + a() this@foo.a() b() } diff --git a/compiler/testData/diagnostics/tests/resolve/dslMarker/threeImplicitReceivers.kt b/compiler/testData/diagnostics/tests/resolve/dslMarker/threeImplicitReceivers.kt index beadda68213..4caa9282a22 100644 --- a/compiler/testData/diagnostics/tests/resolve/dslMarker/threeImplicitReceivers.kt +++ b/compiler/testData/diagnostics/tests/resolve/dslMarker/threeImplicitReceivers.kt @@ -41,7 +41,7 @@ fun test() { baz { y() - x() + x() with(D()) { x() diff --git a/compiler/testData/diagnostics/tests/resolve/dslMarker/threeImplicitReceivers2.kt b/compiler/testData/diagnostics/tests/resolve/dslMarker/threeImplicitReceivers2.kt index 6aae057bbae..e3de4f47a40 100644 --- a/compiler/testData/diagnostics/tests/resolve/dslMarker/threeImplicitReceivers2.kt +++ b/compiler/testData/diagnostics/tests/resolve/dslMarker/threeImplicitReceivers2.kt @@ -37,7 +37,7 @@ fun test() { baz { y() - x() + x() with(D()) { x() diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/errors/typeInferenceErrorForInvoke.kt b/compiler/testData/diagnostics/tests/resolve/invoke/errors/typeInferenceErrorForInvoke.kt index 5ed3ec12220..e80e3bc5fb6 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/errors/typeInferenceErrorForInvoke.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/errors/typeInferenceErrorForInvoke.kt @@ -8,7 +8,7 @@ operator fun T.invoke(a: A) {} fun foo(s: String, ai: A) { 1(ai) - s(ai) + s(ai) ""(ai) } diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/errors/wrongReceiverTypeForInvoke.kt b/compiler/testData/diagnostics/tests/resolve/invoke/errors/wrongReceiverTypeForInvoke.kt index 895b56c673b..1a890f7586d 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/errors/wrongReceiverTypeForInvoke.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/errors/wrongReceiverTypeForInvoke.kt @@ -4,7 +4,7 @@ fun String.invoke(i: Int) {} fun foo(i: Int) { - i(1) + i(1) 1(1) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/extensionValueAsNonExtension.kt b/compiler/testData/diagnostics/tests/resolve/invoke/extensionValueAsNonExtension.kt index e3022a16f8b..e7dc0ec67ae 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/extensionValueAsNonExtension.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/extensionValueAsNonExtension.kt @@ -19,5 +19,5 @@ fun foo(): A.() -> Int { val b: Int = foo()(A()) val c: Int = (foo())(A()) - return null!! + return null!! } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/functionExpectedWhenSeveralInvokesExist.kt b/compiler/testData/diagnostics/tests/resolve/invoke/functionExpectedWhenSeveralInvokesExist.kt index 8dca44daf4a..3acf3163842 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/functionExpectedWhenSeveralInvokesExist.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/functionExpectedWhenSeveralInvokesExist.kt @@ -7,8 +7,8 @@ fun Int.invoke(a: Int, b: Int) {} class SomeClass fun test(identifier: SomeClass, fn: String.() -> Unit) { - identifier() - identifier(123) - identifier(1, 2) - 1.fn() + identifier() + identifier(123) + identifier(1, 2) + 1.fn() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAndSmartCast.kt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAndSmartCast.kt index 12dc450e4da..fee7c010b3b 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAndSmartCast.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAndSmartCast.kt @@ -4,18 +4,18 @@ class A(val x: (String.() -> Unit)?) fun test(a: A) { if (a.x != null) { "".(a.x)() - a.x("") // todo + a.x("") // todo (a.x)("") } "".(a.x)() - a.x("") + a.x("") (a.x)("") with("") { - a.x() + a.x() (a.x)() if (a.x != null) { - a.x() // todo + a.x() // todo (a.x)() } } diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeOnVariableWithExtensionFunctionType.kt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeOnVariableWithExtensionFunctionType.kt index 2d80c60b1a8..8506aab6882 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeOnVariableWithExtensionFunctionType.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/invokeOnVariableWithExtensionFunctionType.kt @@ -17,7 +17,7 @@ fun test(a: A, b: B) { b.(foo)() - (b.foo)() + (b.foo)() foo(b) (foo)(b) @@ -25,7 +25,7 @@ fun test(a: A, b: B) { with(b) { a.foo() - a.(foo)() + a.(foo)() (a.foo)() diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/reportFunctionExpectedWhenOneInvokeExist.kt b/compiler/testData/diagnostics/tests/resolve/invoke/reportFunctionExpectedWhenOneInvokeExist.kt index f82a458249a..4ae07d7d055 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/reportFunctionExpectedWhenOneInvokeExist.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/reportFunctionExpectedWhenOneInvokeExist.kt @@ -6,8 +6,8 @@ fun Int.invoke() {} class SomeClass fun test(identifier: SomeClass, fn: String.() -> Unit) { - identifier() - identifier(123) - identifier(1, 2) - 1.fn() + identifier() + identifier(123) + identifier(1, 2) + 1.fn() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/nestedCalls/completeTypeInferenceForNestedInNoneApplicable.kt b/compiler/testData/diagnostics/tests/resolve/nestedCalls/completeTypeInferenceForNestedInNoneApplicable.kt index 42114fea648..7a12450e8c8 100644 --- a/compiler/testData/diagnostics/tests/resolve/nestedCalls/completeTypeInferenceForNestedInNoneApplicable.kt +++ b/compiler/testData/diagnostics/tests/resolve/nestedCalls/completeTypeInferenceForNestedInNoneApplicable.kt @@ -5,7 +5,7 @@ fun foo(i: Int) = i fun foo(s: String) = s fun test() { - foo(emptyList()) + foo(emptyList()) } fun emptyList(): List {throw Exception()} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/nestedCalls/manyInapplicableCandidatesWithLambdas.kt b/compiler/testData/diagnostics/tests/resolve/nestedCalls/manyInapplicableCandidatesWithLambdas.kt index 5b70468acfd..0dd8d8451e2 100644 --- a/compiler/testData/diagnostics/tests/resolve/nestedCalls/manyInapplicableCandidatesWithLambdas.kt +++ b/compiler/testData/diagnostics/tests/resolve/nestedCalls/manyInapplicableCandidatesWithLambdas.kt @@ -20,20 +20,20 @@ class E { // `bar` calls are inapplicable since both E nor D aren't proper receivers // But prior to this change, every lambda was analyzed repeatedly for every candidate // Thus, the resulting time was exponential - bar { - bar { - bar { - bar { - bar { - bar { - bar { - bar { - bar { - bar { - bar { - bar { - bar { - bar { + bar { + bar { + bar { + bar { + bar { + bar { + bar { + bar { + bar { + bar { + bar { + bar { + bar { + bar { } } diff --git a/compiler/testData/diagnostics/tests/resolve/nestedCalls/twoTypeParameters.kt b/compiler/testData/diagnostics/tests/resolve/nestedCalls/twoTypeParameters.kt index 1ebd4fa0c25..65668e6d6d0 100644 --- a/compiler/testData/diagnostics/tests/resolve/nestedCalls/twoTypeParameters.kt +++ b/compiler/testData/diagnostics/tests/resolve/nestedCalls/twoTypeParameters.kt @@ -11,7 +11,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)) } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/allLambdas.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/allLambdas.kt index c59482f10f7..4e002ee7f8b 100644 --- a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/allLambdas.kt +++ b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/allLambdas.kt @@ -7,4 +7,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 }) \ No newline at end of file +val test: X2 = foo({ 0 }, { it -> it + 1 }) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt10640.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt10640.kt index cbd845273c0..4300405a011 100644 --- a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt10640.kt +++ b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt10640.kt @@ -7,4 +7,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 \ No newline at end of file +fun test3(x: Closeable) = x.myUse<AutoCloseable, Int> { 42 } // TODO KT-10681 \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/originalExamples.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/originalExamples.kt index 1123643b69f..cd9609d816e 100644 --- a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/originalExamples.kt +++ b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/originalExamples.kt @@ -8,7 +8,7 @@ fun overloadedFun1(c: Any = "", b: String = "", f: Any = "") = Right fun overloadedFun1(b: Any = "", c: Any = "", e: String = "") = Wrong val test1: Right = overloadedFun1(b = "") -val test1a: Wrong = overloadedFun1(b = "") +val test1a: Wrong = overloadedFun1(b = "") fun overloadedFun2(a: String, b: Any = "") = Right fun overloadedFun2(a: Any, b: String = "") = Wrong diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/withVariance.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/withVariance.kt index 77213c68ae3..f45d71818a0 100644 --- a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/withVariance.kt +++ b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/withVariance.kt @@ -7,4 +7,4 @@ class A fun A.foo() = X1 fun A.foo() = X2 -fun A.test() = foo() // TODO fix constraint system \ No newline at end of file +fun A.test() = foo() // TODO fix constraint system \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/resolveWithSpecifiedFunctionLiteralWithId.kt b/compiler/testData/diagnostics/tests/resolve/resolveWithSpecifiedFunctionLiteralWithId.kt index 67b4400b312..626182c5195 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/resolve/specialConstructions/constantsInIf.kt b/compiler/testData/diagnostics/tests/resolve/specialConstructions/constantsInIf.kt index 66703cb4ff9..cf98ecab0f7 100644 --- a/compiler/testData/diagnostics/tests/resolve/specialConstructions/constantsInIf.kt +++ b/compiler/testData/diagnostics/tests/resolve/specialConstructions/constantsInIf.kt @@ -2,13 +2,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 \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/specialConstructions/elvisAsCall.kt b/compiler/testData/diagnostics/tests/resolve/specialConstructions/elvisAsCall.kt index 0b288e5f2c0..99b8136a494 100644 --- a/compiler/testData/diagnostics/tests/resolve/specialConstructions/elvisAsCall.kt +++ b/compiler/testData/diagnostics/tests/resolve/specialConstructions/elvisAsCall.kt @@ -14,7 +14,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 } @@ -23,15 +23,15 @@ fun testDataFlowInfo1(a: Int?, b: Int?) { val c: Int = a ?: b!! doInt(c) // b is nullable if a != null - b + 1 + b + 1 } fun testDataFlowInfo2(a: Int?, b: Int?) { doInt(a ?: b!!) // b is nullable if a != null - b + 1 + b + 1 } fun testTypeMismatch(a: String?, b: Any) { - doInt(a ?: b) + doInt(a ?: b) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/specialConstructions/exclExclAsCall.kt b/compiler/testData/diagnostics/tests/resolve/specialConstructions/exclExclAsCall.kt index c6e14c82b14..d13c5392542 100644 --- a/compiler/testData/diagnostics/tests/resolve/specialConstructions/exclExclAsCall.kt +++ b/compiler/testData/diagnostics/tests/resolve/specialConstructions/exclExclAsCall.kt @@ -13,8 +13,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 d932b83ea9a..c5cfc432cb5 100644 --- a/compiler/testData/diagnostics/tests/resolve/specialConstructions/multipleSuperClasses.kt +++ b/compiler/testData/diagnostics/tests/resolve/specialConstructions/multipleSuperClasses.kt @@ -9,7 +9,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 e06430e2cdc..cce34aa4cca 100644 --- a/compiler/testData/diagnostics/tests/resolve/specialConstructions/reportTypeMismatchDeeplyOnBranches.kt +++ b/compiler/testData/diagnostics/tests/resolve/specialConstructions/reportTypeMismatchDeeplyOnBranches.kt @@ -4,25 +4,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 64f0008c26a..f2399e13102 100644 --- a/compiler/testData/diagnostics/tests/resolve/wrongNumberOfTypeArguments.kt +++ b/compiler/testData/diagnostics/tests/resolve/wrongNumberOfTypeArguments.kt @@ -4,12 +4,12 @@ fun foo(t: T) = t fun test1() { - foo("") + foo("") } fun bar(t: T, r: R) {} fun test2() { - bar("", "") + bar("", "") } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/wrongReceiver.kt b/compiler/testData/diagnostics/tests/resolve/wrongReceiver.kt index 29afef1bca2..072fa4b1424 100644 --- a/compiler/testData/diagnostics/tests/resolve/wrongReceiver.kt +++ b/compiler/testData/diagnostics/tests/resolve/wrongReceiver.kt @@ -9,13 +9,13 @@ val Int.foo: Int get() = 4 fun Int.extFun() = 4 fun String.test() { - some + some some.A() - "".some + "".some - foo - "".foo + foo + "".foo - extFun() - "".extFun() + extFun() + "".extFun() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/methodsPriority.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/methodsPriority.kt index e969432d437..a4ebd9f766e 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/methodsPriority.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/methodsPriority.kt @@ -20,7 +20,7 @@ fun test() { class B: A() { init { - val a: Int = foo() // todo + val a: Int = foo() // todo } } } diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromContainingClass.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromContainingClass.kt index 4653123d7d5..1bf3e1f87f9 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromContainingClass.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromContainingClass.kt @@ -11,14 +11,14 @@ open class A : J() { init { foo() bar() - val a: Int = baz() + val a: Int = baz() val b: T = baz() } fun test1() { foo() bar() - val a: Int = baz() + val a: Int = baz() val b: T = baz() } diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/localVsStatic.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/localVsStatic.kt index 912bd91a5c3..69dc5a99286 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/localVsStatic.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/localVsStatic.kt @@ -21,7 +21,7 @@ fun test() { class B: A() { init { - val a: Int = foo() // todo + val a: Int = foo() // todo } } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/scopes/protectedVisibility/nonSuperCallConstructor.kt b/compiler/testData/diagnostics/tests/scopes/protectedVisibility/nonSuperCallConstructor.kt index f467938fb1b..080dcc557f9 100644 --- a/compiler/testData/diagnostics/tests/scopes/protectedVisibility/nonSuperCallConstructor.kt +++ b/compiler/testData/diagnostics/tests/scopes/protectedVisibility/nonSuperCallConstructor.kt @@ -8,14 +8,14 @@ open class A protected constructor(x: Int) { class B4 : A(1) { init { - A() - A(1) + A() + A(1) A(5.0) } fun foo() { - A() - A(1) + A() + A(1) A(5.0) object : A() {} diff --git a/compiler/testData/diagnostics/tests/scopes/protectedVisibility/syntheticSAMExtensions.kt b/compiler/testData/diagnostics/tests/scopes/protectedVisibility/syntheticSAMExtensions.kt index 5daaf0e74c0..f0e62c09462 100644 --- a/compiler/testData/diagnostics/tests/scopes/protectedVisibility/syntheticSAMExtensions.kt +++ b/compiler/testData/diagnostics/tests/scopes/protectedVisibility/syntheticSAMExtensions.kt @@ -21,7 +21,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 108dacf6574..1f5b6865394 100644 --- a/compiler/testData/diagnostics/tests/scopes/protectedVisibility/unstableSmartCast.kt +++ b/compiler/testData/diagnostics/tests/scopes/protectedVisibility/unstableSmartCast.kt @@ -13,7 +13,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/script/NestedInnerClass.kts b/compiler/testData/diagnostics/tests/script/NestedInnerClass.kts index 1fbc2860e60..a23519483ed 100644 --- a/compiler/testData/diagnostics/tests/script/NestedInnerClass.kts +++ b/compiler/testData/diagnostics/tests/script/NestedInnerClass.kts @@ -5,8 +5,8 @@ fun function() = 42 val property = "" class Nested { - fun f() = function() - fun g() = property + fun f() = function() + fun g() = property } diff --git a/compiler/testData/diagnostics/tests/script/destructuringDeclarationsScript.kts b/compiler/testData/diagnostics/tests/script/destructuringDeclarationsScript.kts index 7852cf28d9f..f2f56b93dbb 100644 --- a/compiler/testData/diagnostics/tests/script/destructuringDeclarationsScript.kts +++ b/compiler/testData/diagnostics/tests/script/destructuringDeclarationsScript.kts @@ -1,6 +1,6 @@ // !WITH_NEW_INFERENCE val (a1, a2) = A() -val (b1: Int, b2: Int) = A() +val (b1: Int, b2: Int) = A() val (c1) = unresolved private val (d1) = A() diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/constructorCallType.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/constructorCallType.kt index 97f775ce8e0..b21b73351c6 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/secondaryConstructors/return.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/return.kt index 28315408a5a..e1dd6ba90cf 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/return.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/return.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/smartCasts/alwaysNull.kt b/compiler/testData/diagnostics/tests/smartCasts/alwaysNull.kt index 5dadcfa3f0e..8c8584c556b 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/alwaysNull.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/alwaysNull.kt @@ -3,12 +3,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 } @@ -16,7 +16,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 66baa59bc9a..276bfdff302 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/alwaysNullWithJava.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/alwaysNullWithJava.kt @@ -11,7 +11,7 @@ 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 108a81448bd..b3d4d488fd4 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/castchecks/variables.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/castchecks/variables.kt @@ -41,7 +41,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 @@ -50,7 +50,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 898112f73fd..d41ce7f675a 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/comparisonUnderAnd.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/comparisonUnderAnd.kt @@ -16,12 +16,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 7ce7ba82a27..6b5aaad4310 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/complexComparison.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/complexComparison.kt @@ -7,7 +7,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 8b9c7882a69..8174bd0da67 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/elvis/impossible.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/elvis/impossible.kt @@ -18,7 +18,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) } } @@ -36,6 +36,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/elvisExprNotNull.kt b/compiler/testData/diagnostics/tests/smartCasts/elvisExprNotNull.kt index 64769d9391d..bb233920b03 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/elvisExprNotNull.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/elvisExprNotNull.kt @@ -33,5 +33,5 @@ fun baz(s: String?, r: String?): String { fun withNull(s: String?): String { val t = s ?: null // Error: nullable - return t + return t } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/explicitDefaultGetter.kt b/compiler/testData/diagnostics/tests/smartCasts/explicitDefaultGetter.kt index 30710c6791b..5ea8a1752dd 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/explicitDefaultGetter.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/explicitDefaultGetter.kt @@ -5,7 +5,7 @@ class ExplicitAccessorForAnnotation { fun foo(): String { if (tt is String) { - return tt + return tt } return "" } diff --git a/compiler/testData/diagnostics/tests/smartCasts/inference/intersectionTypes.kt b/compiler/testData/diagnostics/tests/smartCasts/inference/intersectionTypes.kt index fb3fc148bc5..1286554a1f7 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/inference/intersectionTypes.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/inference/intersectionTypes.kt @@ -15,7 +15,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) @@ -29,7 +29,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) } @@ -39,11 +39,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/intersectionScope/flexibleTypes.kt b/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/flexibleTypes.kt index 60734d28f6c..4762b0754ba 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/flexibleTypes.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/flexibleTypes.kt @@ -17,37 +17,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/intersectionScope/unstableSmartCast.kt b/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/unstableSmartCast.kt index ac1fb2d44fb..161ddd49724 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/unstableSmartCast.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/unstableSmartCast.kt @@ -31,8 +31,8 @@ fun test() { x.foo().checkType { _() } x.baz("") x.baz(1).checkType { _() } - x.baz(1, 2) + x.baz(1, 2) - x.foobar().checkType { _() } + x.foobar().checkType { _() } } } diff --git a/compiler/testData/diagnostics/tests/smartCasts/kt10444.kt b/compiler/testData/diagnostics/tests/smartCasts/kt10444.kt index 1883272fde6..62cefffb4b7 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/kt10444.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/kt10444.kt @@ -10,7 +10,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 646abce4250..a44ddf5de2d 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/kt2865.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/kt2865.kt @@ -7,6 +7,6 @@ fun foo(a: MutableMap, x: String?) { } fun foo1(a: MutableMap, x: String?) { - a[x] = x!! + a[x] = x!! a[x!!] = x } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentWithBoundWithoutType.kt b/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentWithBoundWithoutType.kt index 9dd41f2916f..2c178995e25 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentWithBoundWithoutType.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentWithBoundWithoutType.kt @@ -13,14 +13,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/localFunChanges.kt b/compiler/testData/diagnostics/tests/smartCasts/localFunChanges.kt index 7066f3ae02a..d7d642e66fc 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/localFunChanges.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/localFunChanges.kt @@ -9,7 +9,7 @@ fun foo() { return true } i.hashCode() - trans(i, ::can) + trans(i, ::can) i.hashCode() } } diff --git a/compiler/testData/diagnostics/tests/smartCasts/objectLiterals/captured.kt b/compiler/testData/diagnostics/tests/smartCasts/objectLiterals/captured.kt index 65f82d25d30..8e622fb5467 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/objectLiterals/captured.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/objectLiterals/captured.kt @@ -17,7 +17,7 @@ fun foo(): Int { k.run() val d: Int = c // a is captured so smart cast is not possible - return d + a + return d + a } else return -1 } diff --git a/compiler/testData/diagnostics/tests/smartCasts/objectLiterals/exclexcl.kt b/compiler/testData/diagnostics/tests/smartCasts/objectLiterals/exclexcl.kt index 0ab702ecc3d..24c38b0349c 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/objectLiterals/exclexcl.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/objectLiterals/exclexcl.kt @@ -16,7 +16,7 @@ fun foo(): Int { k.run() val d: Int = c // a is not null because of k constructor, but we do not know it - return a + d + return a + d } else return -1 } diff --git a/compiler/testData/diagnostics/tests/smartCasts/propertyAsCondition.kt b/compiler/testData/diagnostics/tests/smartCasts/propertyAsCondition.kt index bad04d13679..b7ea1755df1 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/propertyAsCondition.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/propertyAsCondition.kt @@ -7,7 +7,7 @@ fun doIt() {} fun foo(my: My) { if (my.x != null) { // my.x should be smart-cast - if (my.x) doIt() + if (my.x) doIt() when (my.x) { true -> doIt() } diff --git a/compiler/testData/diagnostics/tests/smartCasts/propertyToNotNull.kt b/compiler/testData/diagnostics/tests/smartCasts/propertyToNotNull.kt index 412d720a42b..88c4bcc346d 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/propertyToNotNull.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/propertyToNotNull.kt @@ -8,7 +8,7 @@ class Immutable(val x: String?) { class Mutable(var y: String?) { fun foo(): String { - if (y != null) return y + if (y != null) return y return "" } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/publicVals/delegate.kt b/compiler/testData/diagnostics/tests/smartCasts/publicVals/delegate.kt index db465a5178c..0a46463872b 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/publicVals/delegate.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/publicVals/delegate.kt @@ -14,7 +14,7 @@ class Example { public fun foo(): String { // Smart cast is not possible if property is delegated - return if (p != null) p else "" + return if (p != null) p else "" } public fun bar(): String { diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/anotherVal.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/anotherVal.kt index e9eb51c37b5..53fe4471413 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/anotherVal.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/anotherVal.kt @@ -1,6 +1,8 @@ +// !WITH_NEW_INFERENCE + fun calc(x: List?, y: Int?): Int { x?.get(y!! - 1) // y!! above should not provide smart cast here - val yy: Int = y + val yy: Int = y return yy + (x?.size ?: 0) } diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/falseSecondArgument.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/falseSecondArgument.kt index e0bc8af3355..be5976f2ac4 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/falseSecondArgument.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/falseSecondArgument.kt @@ -1,5 +1,7 @@ +// !WITH_NEW_INFERENCE + fun calc(x: List?, y: Int?): Int { x?.subList(y!! - 1, y) // y!! above should not provide smart cast here - return y + return y } diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/receiverAndChainFalse.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/receiverAndChainFalse.kt index 0f3c1e2d2ef..977c7d5dffb 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/receiverAndChainFalse.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/receiverAndChainFalse.kt @@ -1,8 +1,10 @@ +// !WITH_NEW_INFERENCE + fun foo(x: String): String? = x fun calc(x: String?, y: Int?): Int { // Smart cast because of x!! in receiver foo(x!!)?.subSequence(y!!, x.length)?.length // No smart cast possible - return y + return y } diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/safeAccessReceiverNotNull.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/safeAccessReceiverNotNull.kt index b8618e95a6d..432d22c1a91 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/safeAccessReceiverNotNull.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/safeAccessReceiverNotNull.kt @@ -130,7 +130,7 @@ class Invokable(val x: String) { class InvokableProperty(val i: Invokable) fun checkInvokable(ip: InvokableProperty?) { - if (ip?.i() == "Hello") { + if (ip?.i() == "Hello") { ip.hashCode() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/typeInComparison.kt b/compiler/testData/diagnostics/tests/smartCasts/typeInComparison.kt index eefbcaff5b2..020fd619a9e 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/typeInComparison.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/typeInComparison.kt @@ -3,7 +3,7 @@ fun foo(): Int { val x: Any? = null val y = 2 if (x == y) { - return x + y + return x + y } return y } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/variables/ifNullAssignment.kt b/compiler/testData/diagnostics/tests/smartCasts/variables/ifNullAssignment.kt index 91080e6588b..b4c09df476a 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/variables/ifNullAssignment.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/variables/ifNullAssignment.kt @@ -69,5 +69,5 @@ fun gau(flag: Boolean, arg: String?) { } } - x.hashCode() + x.hashCode() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/variables/lambdaBetweenArguments.kt b/compiler/testData/diagnostics/tests/smartCasts/variables/lambdaBetweenArguments.kt index 232dfcea0f7..29b21ad80dc 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/variables/lambdaBetweenArguments.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/variables/lambdaBetweenArguments.kt @@ -6,5 +6,5 @@ fun foo(x: Int, f: () -> Unit, y: Int) {} fun bar() { var x: Int? x = 4 - foo(x, { x = null; x.hashCode() }, x) + foo(x, { x = null; x.hashCode() }, x) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/variables/property.kt b/compiler/testData/diagnostics/tests/smartCasts/variables/property.kt index 9080cf27252..ff09a6cf1c2 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/variables/property.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/variables/property.kt @@ -7,5 +7,5 @@ fun bar(s: String): Int { fun foo(m: MyClass): Int { m.p = "xyz" - return bar(m.p) + return bar(m.p) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/assignment.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/assignment.kt index ea604ac8c77..f899cf84aa2 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/assignment.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/assignment.kt @@ -5,7 +5,7 @@ fun foo() { v = "abc" v.length v = null - v.length + v.length v = "abc" v.length } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/boundInitializerWrong.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/boundInitializerWrong.kt index 1044e2a6284..af728f2c7a3 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/boundInitializerWrong.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/boundInitializerWrong.kt @@ -6,7 +6,7 @@ fun foo() { val y = x x = null if (y != null) { - x.hashCode() + x.hashCode() } } @@ -23,7 +23,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/forEach.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/forEach.kt index 3506cfcb632..f94434b040c 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/forEach.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/forEach.kt @@ -13,5 +13,5 @@ fun list(start: SomeObject): SomeObject { e = e.next() } // Smart cast is not possible here due to next() - return e + return e } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/forEachWithBreak.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/forEachWithBreak.kt index 7516bcd91d0..632cf602232 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/forEachWithBreak.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/forEachWithBreak.kt @@ -14,5 +14,5 @@ fun list(start: SomeObject): SomeObject { e.doSomething() e = e.next() } - return e + return e } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/forEachWithContinue.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/forEachWithContinue.kt index 2a779baae76..8d5bd026ddf 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/forEachWithContinue.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/forEachWithContinue.kt @@ -14,5 +14,5 @@ fun list(start: SomeObject): SomeObject { e.doSomething() e = e.next() } - return e + return e } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/initInTryReturnInCatch.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/initInTryReturnInCatch.kt index c8ba0990825..6890bdaf128 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/initInTryReturnInCatch.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/initInTryReturnInCatch.kt @@ -76,5 +76,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 443bd059730..c19833c4ce2 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/initialization.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/initialization.kt @@ -4,5 +4,5 @@ fun foo() { // It is possible in principle to provide smart cast here v.length v = null - v.length + v.length } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/plusplusMinusminus.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/plusplusMinusminus.kt index 619cc29f317..fca1eea8bf3 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/plusplusMinusminus.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/plusplusMinusminus.kt @@ -12,10 +12,10 @@ 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 + return i++ + i } return 0L } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNotnullClassIncrement.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNotnullClassIncrement.kt index 405fe148ede..a8af60b0b89 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNotnullClassIncrement.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNotnullClassIncrement.kt @@ -1,7 +1,7 @@ // !WITH_NEW_INFERENCE 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 5424ddfdaa2..bc4f25b85b7 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNotnullClassIncrement.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNotnullClassIncrement.kt @@ -1,7 +1,7 @@ // !WITH_NEW_INFERENCE 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 a369192dfa1..fcb1401dc28 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessaryWithMap.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessaryWithMap.kt @@ -14,7 +14,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 } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/varCapturedInInlineClosure.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/varCapturedInInlineClosure.kt index 11f1854c6b1..290f8b6f5c9 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/varCapturedInInlineClosure.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/varCapturedInInlineClosure.kt @@ -9,7 +9,7 @@ fun IntArray.forEachIndexed( op: (i: Int, value: Int) -> Unit) { fun max(a: IntArray): Int? { var maxI: Int? = null a.forEachIndexed { i, value -> - if (maxI == null || value >= a[maxI]) + if (maxI == null || value >= a[maxI]) maxI = i } return maxI diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/varIntNull.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/varIntNull.kt index 073d5bbd11f..4d9e5236463 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/varIntNull.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/varIntNull.kt @@ -2,5 +2,5 @@ fun foo(): Int { var i: Int? = 42 i = null - return i + 1 + return i + 1 } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/varNull.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/varNull.kt index 906f46ba00b..da0e7ad3353 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/varNull.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/varNull.kt @@ -2,5 +2,5 @@ fun foo(): Int { var s: String? = "abc" s = null - return s.length + return s.length } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/substitutions/starProjections.kt b/compiler/testData/diagnostics/tests/substitutions/starProjections.kt index 221ac2a366a..932d99dc1d3 100644 --- a/compiler/testData/diagnostics/tests/substitutions/starProjections.kt +++ b/compiler/testData/diagnostics/tests/substitutions/starProjections.kt @@ -17,9 +17,9 @@ interface B, T>> { } fun testB(b: B<*, *>) { - , *>>; B<*, *>)!>b.r().checkType { _() } - , *>>; B<*, *>)!>b.t().checkType { _, *>>() } + b.r().checkType { _() } + b.t().checkType { _, *>>() } - , out B, *>>; B, *>)!>, *>>; B<*, *>)!>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 5444e9faafa..02675574551 100644 --- a/compiler/testData/diagnostics/tests/substitutions/upperBoundsSubstitutionForOverloadResolutionWithAmbiguity.kt +++ b/compiler/testData/diagnostics/tests/substitutions/upperBoundsSubstitutionForOverloadResolutionWithAmbiguity.kt @@ -15,5 +15,5 @@ import foo.* import bar.* fun test(l: List) { - f(l) + f(l) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/substitutions/upperBoundsSubstitutionForOverloadResolutionWithErrorTypes.kt b/compiler/testData/diagnostics/tests/substitutions/upperBoundsSubstitutionForOverloadResolutionWithErrorTypes.kt index 8e10b398ca2..7881086dbfb 100644 --- a/compiler/testData/diagnostics/tests/substitutions/upperBoundsSubstitutionForOverloadResolutionWithErrorTypes.kt +++ b/compiler/testData/diagnostics/tests/substitutions/upperBoundsSubstitutionForOverloadResolutionWithErrorTypes.kt @@ -5,5 +5,5 @@ fun f1(l: List2): T {throw Exception()} // ERR fun f1(c: Collection): T{throw Exception()} fun test(l: List) { - f1(l) + f1(l) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/subtyping/localClasses.kt b/compiler/testData/diagnostics/tests/subtyping/localClasses.kt index 8f116ad0686..7f974b0e2fb 100644 --- a/compiler/testData/diagnostics/tests/subtyping/localClasses.kt +++ b/compiler/testData/diagnostics/tests/subtyping/localClasses.kt @@ -15,5 +15,5 @@ private fun foo() = run { fun test() { var x = foo(1) - x = foo() + x = foo() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/subtyping/nestedIntoLocalClasses.kt b/compiler/testData/diagnostics/tests/subtyping/nestedIntoLocalClasses.kt index 53d549c771c..2dd74687951 100644 --- a/compiler/testData/diagnostics/tests/subtyping/nestedIntoLocalClasses.kt +++ b/compiler/testData/diagnostics/tests/subtyping/nestedIntoLocalClasses.kt @@ -19,5 +19,5 @@ private fun foo() = run { fun test() { var x = foo(1) - x = foo() + x = foo() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/subtyping/nestedLocalClasses.kt b/compiler/testData/diagnostics/tests/subtyping/nestedLocalClasses.kt index ec238c908a8..4d89c4c30ae 100644 --- a/compiler/testData/diagnostics/tests/subtyping/nestedLocalClasses.kt +++ b/compiler/testData/diagnostics/tests/subtyping/nestedLocalClasses.kt @@ -19,5 +19,5 @@ private fun foo() = run { fun test() { var x = foo(1) - x = foo() + x = foo() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/InnerClassInGeneric.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/InnerClassInGeneric.kt index 01e4d1a162e..0f3160e2a19 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/InnerClassInGeneric.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/InnerClassInGeneric.kt @@ -2,7 +2,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/NoNamedArgsAllowed.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/NoNamedArgsAllowed.kt index c0f3ecee47e..3add3166896 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/NoNamedArgsAllowed.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/NoNamedArgsAllowed.kt @@ -1,9 +1,9 @@ // !WITH_NEW_INFERENCE // FILE: KotlinFile.kt fun foo(javaClass: JavaClass) { - javaClass.doSomething(p = 1) { + javaClass.doSomething(p = 1) { bar() - } + } } fun bar(){} diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/ParameterTypeAnnotation.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/ParameterTypeAnnotation.kt index 1bfca31f3ea..97791b6009c 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/ParameterTypeAnnotation.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/ParameterTypeAnnotation.kt @@ -1,7 +1,7 @@ // !WITH_NEW_INFERENCE // FILE: KotlinFile.kt fun foo(javaInterface: JavaInterface) { - javaInterface.doIt(null) { } + javaInterface.doIt(null) { } javaInterface.doIt("", null) } diff --git a/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/ambiguousSuperWithGenerics.kt b/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/ambiguousSuperWithGenerics.kt index b8ba8255065..a24a85c20a0 100644 --- a/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/ambiguousSuperWithGenerics.kt +++ b/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/ambiguousSuperWithGenerics.kt @@ -14,7 +14,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 { @@ -22,9 +22,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 { @@ -32,7 +32,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) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/unqualifiedSuperWithCallableProperty.kt b/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/unqualifiedSuperWithCallableProperty.kt index 402593c0a80..1e12c1dcf49 100644 --- a/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/unqualifiedSuperWithCallableProperty.kt +++ b/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/unqualifiedSuperWithCallableProperty.kt @@ -14,7 +14,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/typealias/boundViolationInTypeAliasConstructor.kt b/compiler/testData/diagnostics/tests/typealias/boundViolationInTypeAliasConstructor.kt index 11c6c3327a2..e352d285a1a 100644 --- a/compiler/testData/diagnostics/tests/typealias/boundViolationInTypeAliasConstructor.kt +++ b/compiler/testData/diagnostics/tests/typealias/boundViolationInTypeAliasConstructor.kt @@ -5,14 +5,14 @@ typealias N = Num typealias N2 = N val x1 = Num<String>("") -val x2 = N<String>("") -val x3 = N2<String>("") +val x2 = N<String>("") +val x3 = N2<String>("") class TColl> typealias TC = TColl typealias TC2 = TC -val y1 = TCollAny>() -val y2 = TCAny>() -val y3 = TC2Any>() +val y1 = TCollAny>() +val y2 = TCAny>() +val y3 = TC2Any>() diff --git a/compiler/testData/diagnostics/tests/typealias/boundsViolationInDeepTypeAliasExpansion.kt b/compiler/testData/diagnostics/tests/typealias/boundsViolationInDeepTypeAliasExpansion.kt index fcf532a4be2..435a78514e2 100644 --- a/compiler/testData/diagnostics/tests/typealias/boundsViolationInDeepTypeAliasExpansion.kt +++ b/compiler/testData/diagnostics/tests/typealias/boundsViolationInDeepTypeAliasExpansion.kt @@ -14,4 +14,4 @@ fun test4(x: TC2>() val test6 = TC2>() val test7 = TC2>() -val test8 = TC2List>() +val test8 = TC2List>() diff --git a/compiler/testData/diagnostics/tests/typealias/boundsViolationInTypeAliasExpansion.kt b/compiler/testData/diagnostics/tests/typealias/boundsViolationInTypeAliasExpansion.kt index 6d59d441282..0cf2b72f456 100644 --- a/compiler/testData/diagnostics/tests/typealias/boundsViolationInTypeAliasExpansion.kt +++ b/compiler/testData/diagnostics/tests/typealias/boundsViolationInTypeAliasExpansion.kt @@ -15,9 +15,9 @@ fun test3(x: NL) {} fun test4(x: NL) {} val test5 = NA() -val test6 = NA<Any>() +val test6 = NA<Any>() val test7 = NL() -val test8 = NL() +val test8 = NL() fun test9(x: TC>) {} fun test10(x: TC>) {} @@ -27,4 +27,4 @@ fun test12(x: TCList>) {} val test13 = TC>() val test14 = TC>() val test15 = TC>() -val test16 = TCList>() +val test16 = TCList>() diff --git a/compiler/testData/diagnostics/tests/typealias/innerClassTypeAliasConstructor.kt b/compiler/testData/diagnostics/tests/typealias/innerClassTypeAliasConstructor.kt index d4ad9f8f2cb..dae4b896e1e 100644 --- a/compiler/testData/diagnostics/tests/typealias/innerClassTypeAliasConstructor.kt +++ b/compiler/testData/diagnostics/tests/typealias/innerClassTypeAliasConstructor.kt @@ -18,5 +18,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() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/typealias/innerClassTypeAliasConstructorInSupertypes.kt b/compiler/testData/diagnostics/tests/typealias/innerClassTypeAliasConstructorInSupertypes.kt index 5cd116cba47..78e5b9fc8de 100644 --- a/compiler/testData/diagnostics/tests/typealias/innerClassTypeAliasConstructorInSupertypes.kt +++ b/compiler/testData/diagnostics/tests/typealias/innerClassTypeAliasConstructorInSupertypes.kt @@ -22,16 +22,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 c3054933319..7132d68b6e5 100644 --- a/compiler/testData/diagnostics/tests/typealias/innerTypeAliasConstructor.kt +++ b/compiler/testData/diagnostics/tests/typealias/innerTypeAliasConstructor.kt @@ -20,5 +20,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 a410e19d1bb..504db72c274 100644 --- a/compiler/testData/diagnostics/tests/typealias/noApproximationInTypeAliasArgumentSubstitution.kt +++ b/compiler/testData/diagnostics/tests/typealias/noApproximationInTypeAliasArgumentSubstitution.kt @@ -12,4 +12,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 6214048ccb3..1c88d728d2f 100644 --- a/compiler/testData/diagnostics/tests/typealias/starProjection.kt +++ b/compiler/testData/diagnostics/tests/typealias/starProjection.kt @@ -10,6 +10,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] \ No newline at end of file +fun test5(x: Map) = check(x)[42] \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorCrazyProjections.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorCrazyProjections.kt index 618465f53c0..12622e13209 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorCrazyProjections.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorCrazyProjections.kt @@ -9,6 +9,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!!) \ No newline at end of file +val test2 = BInIn(listOf(), null!!) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorForProjection.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorForProjection.kt index 8ae439d078d..2127282891a 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorForProjection.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorForProjection.kt @@ -6,8 +6,8 @@ typealias CIn = C typealias COut = C typealias CT = C -val test1 = CStar() -val test2 = CIn() -val test3 = COut() +val test1 = CStar() +val test2 = CIn() +val test3 = COut() val test4 = CT<*>() val test5 = CT>() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorForProjectionInSupertypes.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorForProjectionInSupertypes.kt index 78b259a506d..dcef82eff8a 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorForProjectionInSupertypes.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorForProjectionInSupertypes.kt @@ -6,12 +6,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 3344df760af..db5c64b5d88 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInference.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInference.kt @@ -3,16 +3,15 @@ class Num(val x: Tn) typealias N = Num val test0 = N(1) -val test1 = \(x: T\): N /* = Num */ - is not satisfied: inferred type String is not a subtype of Number)!>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 +19,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) \ No newline at end of file +fun testProjections1(x: Pair) = F(x) +fun testProjections2(x: Pair) = F(x) +fun testProjections3(x: Pair) = F(x) +fun testProjections4(x: Pair) = F(x) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithNestedCalls.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithNestedCalls.kt index 892fc5ce81d..973ce7ce1b8 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithNestedCalls.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithNestedCalls.kt @@ -3,4 +3,4 @@ class Cons(val head: T, val tail: Cons?) typealias C = Cons val test1 = C(1, C(2, null)) -val test2 = C(1, C("", null)) +val test2 = C(1, C("", null)) diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithNestedCalls2.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithNestedCalls2.kt index 998e4c41482..1ebe6cedc58 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithNestedCalls2.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithNestedCalls2.kt @@ -30,8 +30,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 3a5c7837a0a..bbeca5a7967 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithPhantomTypes.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithPhantomTypes.kt @@ -7,11 +7,9 @@ class Hr(val a: A, val b: B) typealias Test = Hr, Bar> val test1 = Test(1, "") -val test2 = \(a: A, b: B\): Test /* = Hr, Bar> */ - is not satisfied: inferred type Int is not a subtype of CharSequence)!>Test(1, 2) +val test2 = Test(1, 2) typealias Bas = Hr, Bar> -val test3 = \(a: T, b: T\): Bas /* = Hr, Bar> */ - is not satisfied: inferred type Int is not a subtype of CharSequence)!>Bas(1, 1) +val test3 = Bas(1, 1) diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorWrongVisibility.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorWrongVisibility.kt index 2c3f0e7d2fc..6e0332ce39e 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorWrongVisibility.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorWrongVisibility.kt @@ -8,20 +8,20 @@ open class MyClass private constructor(val x: Int) { typealias MyAlias = MyClass -val test1 = MyAlias(1) -val test1a = MyClass(1) +val test1 = MyAlias(1) +val test1a = MyClass(1) -val test2 = MyAlias("") -val test2a = MyClass("") +val test2 = MyAlias("") +val test2a = MyClass("") val test3 = MyAlias(1.0) val test3a = MyClass(1.0) class MyDerived : MyClass(1.0) { - val test4 = MyAlias(1) - val test4a = MyClass(1) + val test4 = MyAlias(1) + val test4a = MyClass(1) val test5 = MyAlias("") - val test5a = MyClass("") + val test5a = MyClass("") val test6 = MyAlias(1.0) val test6a = MyClass(1.0) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/typealias/wrongNumberOfArgumentsInTypeAliasConstructor.kt b/compiler/testData/diagnostics/tests/typealias/wrongNumberOfArgumentsInTypeAliasConstructor.kt index cf1d58cd3f5..42e4c577b45 100644 --- a/compiler/testData/diagnostics/tests/typealias/wrongNumberOfArgumentsInTypeAliasConstructor.kt +++ b/compiler/testData/diagnostics/tests/typealias/wrongNumberOfArgumentsInTypeAliasConstructor.kt @@ -19,15 +19,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 testN1a = N<String>("") val testN2 = N(1) diff --git a/compiler/testData/diagnostics/tests/varargs/NullableTypeForVarargArgument.kt b/compiler/testData/diagnostics/tests/varargs/NullableTypeForVarargArgument.kt index 5d3072a3c92..e673aed34dd 100644 --- a/compiler/testData/diagnostics/tests/varargs/NullableTypeForVarargArgument.kt +++ b/compiler/testData/diagnostics/tests/varargs/NullableTypeForVarargArgument.kt @@ -19,15 +19,15 @@ fun bar(x: Int, vararg s: String) {} fun baz(s: String) {} fun f() { - A().foo(1, *args) - bar(2, *args) - baz(*args) + A().foo(1, *args) + bar(2, *args) + baz(*args) } fun g(args: Array?) { if (args != null) { - A().foo(1, *args) + A().foo(1, *args) } A().foo(1, *A.ar) } @@ -38,7 +38,7 @@ class B { fun h(b: B) { if (b.args != null) { - A().foo(1, *b.args) + A().foo(1, *b.args) } } diff --git a/compiler/testData/diagnostics/tests/varargs/assigningArraysToVarargsInAnnotations.kt b/compiler/testData/diagnostics/tests/varargs/assigningArraysToVarargsInAnnotations.kt index 17bdd585b18..e830c54b743 100644 --- a/compiler/testData/diagnostics/tests/varargs/assigningArraysToVarargsInAnnotations.kt +++ b/compiler/testData/diagnostics/tests/varargs/assigningArraysToVarargsInAnnotations.kt @@ -18,7 +18,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/noAssigningArraysToVarargsFeature.kt b/compiler/testData/diagnostics/tests/varargs/noAssigningArraysToVarargsFeature.kt index 78f3a6174d7..fdf985cc372 100644 --- a/compiler/testData/diagnostics/tests/varargs/noAssigningArraysToVarargsFeature.kt +++ b/compiler/testData/diagnostics/tests/varargs/noAssigningArraysToVarargsFeature.kt @@ -12,30 +12,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/BranchBypassVal.kt b/compiler/testData/diagnostics/tests/when/BranchBypassVal.kt index 7268250c185..9b78d51b028 100644 --- a/compiler/testData/diagnostics/tests/when/BranchBypassVal.kt +++ b/compiler/testData/diagnostics/tests/when/BranchBypassVal.kt @@ -8,5 +8,5 @@ fun test(a: Any): String { is A -> q!! } // When is not exhaustive - return q + return q } diff --git a/compiler/testData/diagnostics/tests/when/BranchBypassVar.kt b/compiler/testData/diagnostics/tests/when/BranchBypassVar.kt index df496b12bfe..0dd59cbab82 100644 --- a/compiler/testData/diagnostics/tests/when/BranchBypassVar.kt +++ b/compiler/testData/diagnostics/tests/when/BranchBypassVar.kt @@ -8,5 +8,5 @@ fun test(a: Any) { is A -> q = "1" } // When is not exhaustive - return q + return q } diff --git a/compiler/testData/diagnostics/tests/when/When.kt b/compiler/testData/diagnostics/tests/when/When.kt index bee12737a5f..177fcaa3804 100644 --- a/compiler/testData/diagnostics/tests/when/When.kt +++ b/compiler/testData/diagnostics/tests/when/When.kt @@ -11,7 +11,7 @@ fun foo() : Int { is Any -> 1 s -> 1 1 -> 1 - 1 + a -> 1 + 1 + a -> 1 in 1..a -> 1 !in 1..a -> 1 else -> 1 diff --git a/compiler/testData/diagnostics/tests/when/kt10439.kt b/compiler/testData/diagnostics/tests/when/kt10439.kt index 485441e059d..09948bf0720 100644 --- a/compiler/testData/diagnostics/tests/when/kt10439.kt +++ b/compiler/testData/diagnostics/tests/when/kt10439.kt @@ -2,12 +2,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 74376006844..eb83085bc91 100644 --- a/compiler/testData/diagnostics/tests/when/kt10809.kt +++ b/compiler/testData/diagnostics/tests/when/kt10809.kt @@ -8,7 +8,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 { @@ -35,7 +35,7 @@ fun test1x(o: Any): Data? = when (o) { } fun test2() = - if (true) + 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 872e8edf3a0..9d6bbf47c28 100644 --- a/compiler/testData/diagnostics/tests/when/kt9929.kt +++ b/compiler/testData/diagnostics/tests/when/kt9929.kt @@ -1,10 +1,10 @@ // !WITH_NEW_INFERENCE -val test: Int = if (true) { +val test: Int = if (true) { when (2) { 1 -> 1 - else -> null + else -> null } -} +} else { 2 } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/when/kt9972.kt b/compiler/testData/diagnostics/tests/when/kt9972.kt index 0468e7b8976..59c73aad218 100644 --- a/compiler/testData/diagnostics/tests/when/kt9972.kt +++ b/compiler/testData/diagnostics/tests/when/kt9972.kt @@ -1,18 +1,18 @@ // !WITH_NEW_INFERENCE fun test1(): Int { - val x: String = if (true) { + val x: String = if (true) { when { - true -> Any() - else -> null + true -> Any() + else -> null } - } else "" + } else "" return x.hashCode() } fun test2(): Int { - val x: String = when { - true -> Any() + val x: String = when { + true -> Any() else -> null - } ?: return 0 + } ?: return 0 return x.hashCode() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/when/whenAndLambdaWithExpectedType.kt b/compiler/testData/diagnostics/tests/when/whenAndLambdaWithExpectedType.kt index 150814a5180..b238e4b8658 100644 --- a/compiler/testData/diagnostics/tests/when/whenAndLambdaWithExpectedType.kt +++ b/compiler/testData/diagnostics/tests/when/whenAndLambdaWithExpectedType.kt @@ -19,7 +19,7 @@ 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 6f5fb549109..12c7315184b 100644 --- a/compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt +++ b/compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt @@ -1,6 +1,6 @@ // !WITH_NEW_INFERENCE -val test1 = when { - true -> { { true } } +val test1 = when { + true -> { { true } } else -> TODO() } @@ -9,10 +9,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() } } @@ -20,14 +20,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() }