From 4605a65f415802651490a871b51546ab7cffa3b1 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Thu, 10 Sep 2020 09:24:45 +0300 Subject: [PATCH] [FIR] Good test data fixes (around captured types) --- .../references/referenceToExtension.txt | 4 ++-- .../resolve/typeAliasWithTypeArguments.kt | 8 ++++---- .../resolve/typeAliasWithTypeArguments.txt | 8 ++++---- .../builtinFunctionsToString.kt | 1 - .../typeMismatchDueToTypeProjections.fir.kt | 2 +- .../kt7383_starProjectedFunction.fir.kt | 2 +- .../tests/generics/Projections.fir.kt | 12 +++++------ .../innerClasses/simpleOutUseSite.fir.kt | 6 +++--- .../generics/projectionsScope/addAll.fir.kt | 14 ++++++------- .../extensionReceiverTypeMismatch.fir.kt | 6 +++--- .../projectionsScope/inValueParameter.fir.kt | 2 +- .../projectionsScope/lambdaArgument.fir.kt | 16 --------------- .../projectionsScope/lambdaArgument.kt | 1 + .../leakedApproximatedType.fir.kt | 4 ++-- .../multipleArgumentProjectedOut.fir.kt | 2 +- .../projectedOutConventions.fir.kt | 6 +++--- .../starNullabilityRecursive.fir.kt | 9 --------- .../starNullabilityRecursive.kt | 1 + .../projectionsScope/superClass.fir.kt | 12 ----------- .../generics/projectionsScope/superClass.kt | 1 + .../typeMismatchConventions.fir.kt | 6 +++--- .../typeParameterBounds.fir.kt | 20 +++++++++---------- .../generics/projectionsScope/varargs.fir.kt | 6 +++--- .../setterNotProjectedOutAssign.fir.kt | 2 +- .../memberScopeOfCaptured.fir.kt | 12 ----------- .../capturedTypes/memberScopeOfCaptured.kt | 1 + .../tests/j+k/arrayOfStarParametrized.fir.kt | 14 ------------- .../tests/j+k/arrayOfStarParametrized.kt | 1 + .../tests/j+k/wrongVarianceInJava.fir.kt | 4 ++-- .../tests/regressions/kt12898.fir.kt | 2 +- .../genericWithProjection.fir.kt | 4 ++-- .../substitutions/starProjections.fir.kt | 2 +- .../samAdapters/GenericClass.fir.kt | 2 +- .../GenericMethodInGenericClass.fir.kt | 2 +- .../tests/typealias/starProjection.fir.kt | 4 ++-- ...ypeAliasConstructorCrazyProjections.fir.kt | 2 +- .../testsWithStdLib/addAllProjection.fir.kt | 8 ++++---- .../diagnostics/notLinked/dfa/pos/58.fir.kt | 2 +- 38 files changed, 76 insertions(+), 135 deletions(-) delete mode 100644 compiler/testData/diagnostics/tests/generics/projectionsScope/lambdaArgument.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/generics/projectionsScope/starNullabilityRecursive.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/generics/projectionsScope/superClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/capturedTypes/memberScopeOfCaptured.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/arrayOfStarParametrized.fir.kt diff --git a/compiler/fir/analysis-tests/testData/resolve/references/referenceToExtension.txt b/compiler/fir/analysis-tests/testData/resolve/references/referenceToExtension.txt index 721f6f75023..0d0ef4dc4ce 100644 --- a/compiler/fir/analysis-tests/testData/resolve/references/referenceToExtension.txt +++ b/compiler/fir/analysis-tests/testData/resolve/references/referenceToExtension.txt @@ -35,8 +35,8 @@ FILE: referenceToExtension.kt } public final fun test_1(): R|kotlin/Unit| { - lval memberValRef: R|kotlin/reflect/KProperty1, GenericTest.A>| = Q|GenericTest.B|::R|FakeOverride|>| - lval memberFunRef: R|kotlin/reflect/KFunction1, GenericTest.A>| = Q|GenericTest.B|::R|FakeOverride|>| + lval memberValRef: R|kotlin/reflect/KProperty1, GenericTest.A>| = Q|GenericTest.B|::R|FakeOverride|>| + lval memberFunRef: R|kotlin/reflect/KFunction1, GenericTest.A>| = Q|GenericTest.B|::R|FakeOverride|>| } public final fun test_2(): R|kotlin/Unit| { diff --git a/compiler/fir/analysis-tests/testData/resolve/typeAliasWithTypeArguments.kt b/compiler/fir/analysis-tests/testData/resolve/typeAliasWithTypeArguments.kt index 436c229d332..39b2db7dbaf 100644 --- a/compiler/fir/analysis-tests/testData/resolve/typeAliasWithTypeArguments.kt +++ b/compiler/fir/analysis-tests/testData/resolve/typeAliasWithTypeArguments.kt @@ -74,21 +74,21 @@ typealias Invariant1 = Invariant fun test_5(a: A, in1: In1, in2: In1, in3: In1) { in1.take(a) in2.take(a) - in3.take(a) + in3.take(a) } fun test_6(a: A, out1: Out1, out2: Out1, out3: Out1) { out1.value().foo() - out2.value().foo() + out2.value().foo() out3.value().foo() } fun test_7(a: A, inv1: Invariant1, inv2: Invariant1, inv3: Invariant1) { inv1.value().foo() - inv2.value().foo() + inv2.value().foo() inv3.value().foo() inv1.take(a) inv2.take(a) - inv3.take(a) + inv3.take(a) } \ No newline at end of file diff --git a/compiler/fir/analysis-tests/testData/resolve/typeAliasWithTypeArguments.txt b/compiler/fir/analysis-tests/testData/resolve/typeAliasWithTypeArguments.txt index 0e9bae266bf..ef16c2aa4a3 100644 --- a/compiler/fir/analysis-tests/testData/resolve/typeAliasWithTypeArguments.txt +++ b/compiler/fir/analysis-tests/testData/resolve/typeAliasWithTypeArguments.txt @@ -68,18 +68,18 @@ FILE: typeAliasWithTypeArguments.kt public final fun test_5(a: R|A|, in1: R|In1|, in2: R|In1|, in3: R|In1|): R|kotlin/Unit| { R|/in1|.R|FakeOverride|(R|/a|) R|/in2|.R|FakeOverride|(R|/a|) - R|/in3|.R|FakeOverride|(R|/a|) + R|/in3|.#(R|/a|) } public final fun test_6(a: R|A|, out1: R|Out1|, out2: R|Out1|, out3: R|Out1|): R|kotlin/Unit| { R|/out1|.R|FakeOverride|().R|/A.foo|() - R|/out2|.R|FakeOverride|().R|/A.foo|() + R|/out2|.R|FakeOverride|().#() R|/out3|.R|FakeOverride|().R|/A.foo|() } public final fun test_7(a: R|A|, inv1: R|Invariant1|, inv2: R|Invariant1|, inv3: R|Invariant1|): R|kotlin/Unit| { R|/inv1|.R|FakeOverride|().R|/A.foo|() - R|/inv2|.R|FakeOverride|().R|/A.foo|() + R|/inv2|.R|FakeOverride|().#() R|/inv3|.R|FakeOverride|().R|/A.foo|() R|/inv1|.R|FakeOverride|(R|/a|) R|/inv2|.R|FakeOverride|(R|/a|) - R|/inv3|.R|FakeOverride|(R|/a|) + R|/inv3|.#(R|/a|) } diff --git a/compiler/testData/codegen/box/reflection/methodsFromAny/builtinFunctionsToString.kt b/compiler/testData/codegen/box/reflection/methodsFromAny/builtinFunctionsToString.kt index 27f7d5f3618..5c7bc1de260 100644 --- a/compiler/testData/codegen/box/reflection/methodsFromAny/builtinFunctionsToString.kt +++ b/compiler/testData/codegen/box/reflection/methodsFromAny/builtinFunctionsToString.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // SKIP_JDK6 // TARGET_BACKEND: JVM // FULL_JDK diff --git a/compiler/testData/diagnostics/tests/annotations/rendering/typeMismatchDueToTypeProjections.fir.kt b/compiler/testData/diagnostics/tests/annotations/rendering/typeMismatchDueToTypeProjections.fir.kt index 79b90d1f64c..87dbe8aebb3 100644 --- a/compiler/testData/diagnostics/tests/annotations/rendering/typeMismatchDueToTypeProjections.fir.kt +++ b/compiler/testData/diagnostics/tests/annotations/rendering/typeMismatchDueToTypeProjections.fir.kt @@ -14,5 +14,5 @@ class C { class Out fun test(a: C, y: Out) { - a + y + a + y } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionLiterals/kt7383_starProjectedFunction.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/kt7383_starProjectedFunction.fir.kt index 2fc651f8136..b5a2705d497 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/kt7383_starProjectedFunction.fir.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/kt7383_starProjectedFunction.fir.kt @@ -3,5 +3,5 @@ fun foo() { val f : Function1<*, *> = { x -> x.toString() } - f(1) + f(1) } diff --git a/compiler/testData/diagnostics/tests/generics/Projections.fir.kt b/compiler/testData/diagnostics/tests/generics/Projections.fir.kt index 483b2e5a128..e28b7ae63cd 100644 --- a/compiler/testData/diagnostics/tests/generics/Projections.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/Projections.fir.kt @@ -21,7 +21,7 @@ class Inv() { fun testInOut() { In().f("1"); (null as In).f("1") - (null as In<*>).f("1") // Wrong Arg + (null as In<*>).f("1") // Wrong Arg In().f(1); (null as In).f(1) @@ -37,16 +37,16 @@ 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 + checkSubtype((null as Inv).outf()) // Type mismatch (null as Inv).outf() (null as Inv<*>).outf() diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/simpleOutUseSite.fir.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/simpleOutUseSite.fir.kt index b894c10f9f9..c16e0722bb5 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/simpleOutUseSite.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/simpleOutUseSite.fir.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/projectionsScope/addAll.fir.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/addAll.fir.kt index f5fc027d2df..0283c5eb433 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/addAll.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/addAll.fir.kt @@ -15,18 +15,18 @@ fun mc(): MC = null!! fun c(): C = null!! fun foo(x: MC) { - x.addAll(x) - x.addAllMC(x) + x.addAll(x) + x.addAllMC(x) - x.addAll(mc()) - x.addAllMC(mc()) + x.addAll(mc()) + x.addAllMC(mc()) - x.addAll(mc()) - x.addAllMC(mc()) + x.addAll(mc()) + x.addAllMC(mc()) x.addAll(c()) x.addAll(c()) - x.addAllInv(mc()) + x.addAllInv(mc()) x.addAll(1) } diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/extensionReceiverTypeMismatch.fir.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/extensionReceiverTypeMismatch.fir.kt index 69cd0e36317..86934ecf1fa 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/extensionReceiverTypeMismatch.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/extensionReceiverTypeMismatch.fir.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.fir.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/inValueParameter.fir.kt index 860f65e3b75..11fa0b761b8 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/inValueParameter.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/inValueParameter.fir.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/lambdaArgument.fir.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/lambdaArgument.fir.kt deleted file mode 100644 index 35247f1b5d9..00000000000 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/lambdaArgument.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -// !CHECK_TYPE - -class A { - fun foo(f: (T) -> Unit) {} -} - -fun test(a: A, b: A) { - a.foo { - it checkType { _() } - } - - b.foo { - it checkType { _() } - } -} diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/lambdaArgument.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/lambdaArgument.kt index 8a6cf24aa9f..6bf23a8832f 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/lambdaArgument.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/lambdaArgument.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER // !CHECK_TYPE diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/leakedApproximatedType.fir.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/leakedApproximatedType.fir.kt index a5262457bdd..7660b1dedb8 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/leakedApproximatedType.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/leakedApproximatedType.fir.kt @@ -14,6 +14,6 @@ fun test(a: A, y: Out) { val i = a.foo() // TODO: These diagnostic are wrong, type of 'i' --- 'In' is not projected itself, // but it's approximation result caused by 'a' projection - i.invoke1("") - i.invoke2(y) + i.invoke1("") + i.invoke2(y) } diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/multipleArgumentProjectedOut.fir.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/multipleArgumentProjectedOut.fir.kt index e7dd1a5f2e0..dc8ef0fce76 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/multipleArgumentProjectedOut.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/multipleArgumentProjectedOut.fir.kt @@ -6,5 +6,5 @@ class A { } fun test(a: A) { - a.foo("", "") + a.foo("", "") } diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/projectedOutConventions.fir.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/projectedOutConventions.fir.kt index aeeb144c0bf..2ce7570c7cb 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/projectedOutConventions.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/projectedOutConventions.fir.kt @@ -8,7 +8,7 @@ class A { } fun test(a: A) { - a + "" - a[1] = "" - a[""] + a + "" + a[1] = "" + a[""] } diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/starNullabilityRecursive.fir.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/starNullabilityRecursive.fir.kt deleted file mode 100644 index 46a58ae16a9..00000000000 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/starNullabilityRecursive.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// !WITH_NEW_INFERENCE -// !DIAGNOSTICS: -UNUSED_PARAMETER -// !CHECK_TYPE -interface A?> { - fun foo(): T? -} -fun testA(a: A<*>) { - a.foo() checkType { _?>() } -} diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/starNullabilityRecursive.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/starNullabilityRecursive.kt index 7a5f0dc7fdd..a74e605d5f4 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/starNullabilityRecursive.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/starNullabilityRecursive.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !WITH_NEW_INFERENCE // !DIAGNOSTICS: -UNUSED_PARAMETER // !CHECK_TYPE diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/superClass.fir.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/superClass.fir.kt deleted file mode 100644 index 5ea9a64097d..00000000000 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/superClass.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !CHECK_TYPE - -interface Clazz { - val t: T - fun getSuperClass(): Clazz -} - -fun test(clazz: Clazz<*>) { - clazz.t checkType { _() } - clazz.getSuperClass() checkType { _>() } - clazz.getSuperClass().t checkType { _() } -} diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/superClass.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/superClass.kt index 5acc03145cd..2842537dadc 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/superClass.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/superClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE interface Clazz { diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/typeMismatchConventions.fir.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/typeMismatchConventions.fir.kt index f976f1248d6..2de22c03be5 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/typeMismatchConventions.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/typeMismatchConventions.fir.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/typeParameterBounds.fir.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/typeParameterBounds.fir.kt index de0ef7c1b87..54fd73a48fc 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/typeParameterBounds.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/typeParameterBounds.fir.kt @@ -13,15 +13,15 @@ class A { } fun foo2(a: A, b: A) { - a.foo1(Out()) - a.foo1>(Out()) + a.foo1(Out()) + a.foo1>(Out()) a.foo1(Out()) a.foo1(Out()) - a.foo2(Inv()) - a.foo2(Inv()) - a.foo2>(Inv()) + a.foo2(Inv()) + a.foo2(Inv()) + a.foo2>(Inv()) a.foo3(In()) a.foo3(In()) @@ -31,13 +31,13 @@ fun foo2(a: A, b: A) { b.foo1(Out()) b.foo1>(Out()) - b.foo2(Inv()) - b.foo2(Inv()) - b.foo2>(Inv()) + b.foo2(Inv()) + b.foo2(Inv()) + b.foo2>(Inv()) - b.foo3(In()) - b.foo3>(In()) + b.foo3(In()) + b.foo3>(In()) b.foo3(In()) b.foo3(In()) diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/varargs.fir.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/varargs.fir.kt index 0d6b3130aad..59951f0d8df 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/varargs.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/varargs.fir.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/varProjection/setterNotProjectedOutAssign.fir.kt b/compiler/testData/diagnostics/tests/generics/varProjection/setterNotProjectedOutAssign.fir.kt index 0d4d739096a..43e03f9af31 100644 --- a/compiler/testData/diagnostics/tests/generics/varProjection/setterNotProjectedOutAssign.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/varProjection/setterNotProjectedOutAssign.fir.kt @@ -6,5 +6,5 @@ interface Tr { fun test(t: Tr<*>) { t.v = t - t.v checkType { _>() } + t.v checkType { _>() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/memberScopeOfCaptured.fir.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/memberScopeOfCaptured.fir.kt deleted file mode 100644 index ec3e58cb823..00000000000 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/memberScopeOfCaptured.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !CHECK_TYPE - -class A { - fun foo(): T = null!! -} - -fun A.bar(): A = this - -fun baz(x: A) { - x.bar() checkType { _>() } - x.bar().foo() checkType { _() } // See KT-10448 -} diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/memberScopeOfCaptured.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/memberScopeOfCaptured.kt index 4fa525294fa..0e4e5cce82a 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/memberScopeOfCaptured.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/memberScopeOfCaptured.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE class A { diff --git a/compiler/testData/diagnostics/tests/j+k/arrayOfStarParametrized.fir.kt b/compiler/testData/diagnostics/tests/j+k/arrayOfStarParametrized.fir.kt deleted file mode 100644 index cf3299ac494..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/arrayOfStarParametrized.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// !CHECK_TYPE - -// FILE: A.java -public class A { - public A[] baz() { return null; } -} - - -// FILE: main.kt - -fun foo1(x: A<*>) = x.baz() -fun foo2(x: A<*>) { - x.baz() checkType { _>>() } -} diff --git a/compiler/testData/diagnostics/tests/j+k/arrayOfStarParametrized.kt b/compiler/testData/diagnostics/tests/j+k/arrayOfStarParametrized.kt index 79debb0c3f1..f378b6eccc6 100644 --- a/compiler/testData/diagnostics/tests/j+k/arrayOfStarParametrized.kt +++ b/compiler/testData/diagnostics/tests/j+k/arrayOfStarParametrized.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // FILE: A.java diff --git a/compiler/testData/diagnostics/tests/j+k/wrongVarianceInJava.fir.kt b/compiler/testData/diagnostics/tests/j+k/wrongVarianceInJava.fir.kt index 51c01f1e910..0c3a1fd26da 100644 --- a/compiler/testData/diagnostics/tests/j+k/wrongVarianceInJava.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/wrongVarianceInJava.fir.kt @@ -19,6 +19,6 @@ class In { } fun test() { - A.foo().x() checkType { _() } - A.bar().y(null) + A.foo().x() checkType { _() } + A.bar().y(null) } diff --git a/compiler/testData/diagnostics/tests/regressions/kt12898.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt12898.fir.kt index ce0ae536fcd..47770ff2ace 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt12898.fir.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt12898.fir.kt @@ -10,7 +10,7 @@ class C(override val t: Any?) : B fun f(b: B<*, Any>) { val y = b.t if (y is String?) { - y.length + y.length } } diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/genericWithProjection.fir.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/genericWithProjection.fir.kt index 5b61a9298d8..f63f9f44948 100644 --- a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/genericWithProjection.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/genericWithProjection.fir.kt @@ -7,5 +7,5 @@ class In() { fun test1(x: In): Unit = x.f("1") fun test2(x: In): Unit = x.f("1") -fun test3(x: In): Unit = x.f("1") -fun test4(x: In<*>): Unit = x.f("1") \ No newline at end of file +fun test3(x: In): Unit = x.f("1") +fun test4(x: In<*>): Unit = x.f("1") \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/substitutions/starProjections.fir.kt b/compiler/testData/diagnostics/tests/substitutions/starProjections.fir.kt index c3acdadbf5f..70d7a52c781 100644 --- a/compiler/testData/diagnostics/tests/substitutions/starProjections.fir.kt +++ b/compiler/testData/diagnostics/tests/substitutions/starProjections.fir.kt @@ -8,7 +8,7 @@ interface A> { fun testA(a: A<*, *>) { a.r().checkType { _() } - a.t().checkType { _>() } + a.t().checkType { _>() } } interface B, T>> { diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/GenericClass.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/GenericClass.fir.kt index e49e9eba107..9240e501a88 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/GenericClass.fir.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/GenericClass.fir.kt @@ -1,7 +1,7 @@ // JAVAC_EXPECTED_FILE // FILE: KotlinFile.kt fun foo(javaClass: JavaClass): String { - return javaClass.doSomething("", 1) { s: String -> "" } + return javaClass.doSomething("", 1) { s: String -> "" } } // FILE: JavaClass.java diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/GenericMethodInGenericClass.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/GenericMethodInGenericClass.fir.kt index 036f6bcf97f..d049ef22f15 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/GenericMethodInGenericClass.fir.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/GenericMethodInGenericClass.fir.kt @@ -2,7 +2,7 @@ // FILE: KotlinFile.kt fun foo(javaClass: JavaClass) { val a: String = javaClass.doSomething1("", 1) { p: String -> p } - val b: String = javaClass.doSomething2("", 1, true) { p: Int -> p } + val b: String = javaClass.doSomething2("", 1, true) { p: Int -> p } } // FILE: JavaClass.java diff --git a/compiler/testData/diagnostics/tests/typealias/starProjection.fir.kt b/compiler/testData/diagnostics/tests/typealias/starProjection.fir.kt index 2b0c3acbeed..c30441b6756 100644 --- a/compiler/testData/diagnostics/tests/typealias/starProjection.fir.kt +++ b/compiler/testData/diagnostics/tests/typealias/starProjection.fir.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.fir.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorCrazyProjections.fir.kt index a62fe72bb32..c2b8b12cbf2 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorCrazyProjections.fir.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorCrazyProjections.fir.kt @@ -11,6 +11,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 diff --git a/compiler/testData/diagnostics/testsWithStdLib/addAllProjection.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/addAllProjection.fir.kt index 1e5d8fbe0f5..502b2d7dc9a 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/addAllProjection.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/addAllProjection.fir.kt @@ -3,12 +3,12 @@ fun test(mc: MutableCollection) { mc.addAll(mc) - mc.addAll(arrayListOf()) + mc.addAll(arrayListOf()) mc.addAll(arrayListOf()) - mc.addAll(listOf("")) - mc.addAll(listOf("")) - mc.addAll(listOf("")) + mc.addAll(listOf("")) + mc.addAll(listOf("")) + mc.addAll(listOf("")) mc.addAll(emptyList()) mc.addAll(emptyList()) diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/58.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/58.fir.kt index 381be5725c1..224d362be6e 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/58.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/58.fir.kt @@ -74,7 +74,7 @@ fun case_6() { var y: Inv = Inv() if (true) y = x - y.put(0) + y.put(0) val z: Inv = x z.put(0) }