diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt index 21dd8404514..61cbca3d49a 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt @@ -403,8 +403,8 @@ class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransformer) } val label = anonymousFunction.label - return if (label != null && receiverTypeRef is FirResolvedTypeRef) { - withLabelAndReceiverType(Name.identifier(label.name), anonymousFunction, receiverTypeRef.type) { + return if (label != null || receiverTypeRef is FirResolvedTypeRef) { + withLabelAndReceiverType(label?.name?.let { Name.identifier(it) }, anonymousFunction, receiverTypeRef?.coneTypeSafe()) { transform() } } else { diff --git a/compiler/testData/diagnostics/tests/callableReference/callableReferenceAsLastExpressionInBlock.fir.kt b/compiler/testData/diagnostics/tests/callableReference/callableReferenceAsLastExpressionInBlock.fir.kt index a0fbbd4e5fc..357e98bcb2f 100644 --- a/compiler/testData/diagnostics/tests/callableReference/callableReferenceAsLastExpressionInBlock.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/callableReferenceAsLastExpressionInBlock.fir.kt @@ -11,7 +11,7 @@ fun test() { } else { ::foo } - a checkType { _>() } + a checkType { _>() } } fun foo(): Int = 0 diff --git a/compiler/testData/diagnostics/tests/callableReference/function/extensionToSupertype.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/extensionToSupertype.fir.kt index d7ff99df247..cd886eb65e8 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/extensionToSupertype.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/extensionToSupertype.fir.kt @@ -13,7 +13,7 @@ fun take(f: (A) -> Unit) {} fun take(f: () -> Unit) {} fun test() { - B::foo checkType { _>() } + B::foo checkType { _>() } take(B::foo) } diff --git a/compiler/testData/diagnostics/tests/callableReference/function/fakeOverrideType.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/fakeOverrideType.fir.kt index 821dffbb84b..89bbbfa27c2 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/fakeOverrideType.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/fakeOverrideType.fir.kt @@ -11,7 +11,7 @@ class B : A() { fun test() { - B::foo checkType { _>() } + B::foo checkType { _>() } (B::hashCode)("No.") } diff --git a/compiler/testData/diagnostics/tests/callableReference/property/samePriorityForFunctionsAndProperties.fir.kt b/compiler/testData/diagnostics/tests/callableReference/property/samePriorityForFunctionsAndProperties.fir.kt deleted file mode 100644 index 218a2795117..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/property/samePriorityForFunctionsAndProperties.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// !CHECK_TYPE - -import kotlin.reflect.KProperty1 - -class C { - val baz: Int = 12 -} - -fun Int.baz() {} - -fun test() { - C::baz checkType { _>() } -} diff --git a/compiler/testData/diagnostics/tests/callableReference/property/samePriorityForFunctionsAndProperties.kt b/compiler/testData/diagnostics/tests/callableReference/property/samePriorityForFunctionsAndProperties.kt index 6bedc84c041..1b19216725c 100644 --- a/compiler/testData/diagnostics/tests/callableReference/property/samePriorityForFunctionsAndProperties.kt +++ b/compiler/testData/diagnostics/tests/callableReference/property/samePriorityForFunctionsAndProperties.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE import kotlin.reflect.KProperty1 diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/overloads.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/overloads.fir.kt index 60effb9908c..b5d54864ccd 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/overloads.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/overloads.fir.kt @@ -22,7 +22,7 @@ fun fas(i: Int = 1) {} fun test() { B::foo // todo KT-9601 Chose maximally specific function in callable reference - B::bar checkType { _>() } + B::bar checkType { _>() } B::bas diff --git a/compiler/testData/diagnostics/tests/checkType.fir.kt b/compiler/testData/diagnostics/tests/checkType.fir.kt index f1e5dad30ab..70bf2b6d137 100644 --- a/compiler/testData/diagnostics/tests/checkType.fir.kt +++ b/compiler/testData/diagnostics/tests/checkType.fir.kt @@ -6,7 +6,7 @@ interface B : A interface C : B fun test(b: B) { - b checkType { _() } - b checkType { _() } - b checkType { _() } + b checkType { _() } + b checkType { _() } + b checkType { _() } } diff --git a/compiler/testData/diagnostics/tests/collectionLiterals/basicCollectionLiterals.fir.kt b/compiler/testData/diagnostics/tests/collectionLiterals/basicCollectionLiterals.fir.kt index dd381a3eb8c..374e2afb643 100644 --- a/compiler/testData/diagnostics/tests/collectionLiterals/basicCollectionLiterals.fir.kt +++ b/compiler/testData/diagnostics/tests/collectionLiterals/basicCollectionLiterals.fir.kt @@ -14,11 +14,11 @@ fun test() { } fun check() { - [1, 2] checkType { _>() } - [""] checkType { _>() } + [1, 2] checkType { _>() } + [""] checkType { _>() } val f: IntArray = [1] - [f] checkType { _>() } + [f] checkType { _>() } - [1, ""] checkType { _>() } + [1, ""] checkType { _>() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/controlStructures/ifElseIntersection.fir.kt b/compiler/testData/diagnostics/tests/controlStructures/ifElseIntersection.fir.kt index d36e959db14..659695922fc 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/ifElseIntersection.fir.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/ifElseIntersection.fir.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 } @@ -48,7 +48,7 @@ class SimpleNone : SimpleOption fun bindNoGeneric(r: SimpleOption): SimpleOption { return if (r is SimpleSome) { - (if (true) SimpleNone() else r) checkType { _() } + (if (true) SimpleNone() else r) checkType { _() } if (true) SimpleNone() else r } else r diff --git a/compiler/testData/diagnostics/tests/controlStructures/typeInferenceForExclExcl.fir.kt b/compiler/testData/diagnostics/tests/controlStructures/typeInferenceForExclExcl.fir.kt index b136b408f54..195ba2a2ef4 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/typeInferenceForExclExcl.fir.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/typeInferenceForExclExcl.fir.kt @@ -12,10 +12,10 @@ fun exclExcl(t: T?): T = t!! fun test11() { // not 'String!' - exclExcl(A.foo()) checkType { _() } - exclExcl(A.foo()) checkType { _() } + exclExcl(A.foo()) checkType { _() } + exclExcl(A.foo()) checkType { _() } // not 'String!' - A.foo()!! checkType { _() } - A.foo()!! checkType { _() } + A.foo()!! checkType { _() } + A.foo()!! checkType { _() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/coroutines/callableReference/outsideSuspend.fir.kt b/compiler/testData/diagnostics/tests/coroutines/callableReference/outsideSuspend.fir.kt index a3c6e936dbf..b765a7bd023 100644 --- a/compiler/testData/diagnostics/tests/coroutines/callableReference/outsideSuspend.fir.kt +++ b/compiler/testData/diagnostics/tests/coroutines/callableReference/outsideSuspend.fir.kt @@ -7,5 +7,5 @@ import kotlin.reflect.KSuspendFunction0 suspend fun foo() {} fun test() { - ::foo checkType { _>() } + ::foo checkType { _>() } } diff --git a/compiler/testData/diagnostics/tests/declarationChecks/anonymousFunAsLastExpressionInBlock.fir.kt b/compiler/testData/diagnostics/tests/declarationChecks/anonymousFunAsLastExpressionInBlock.fir.kt index c43ed114e65..a9e6167b5a6 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/anonymousFunAsLastExpressionInBlock.fir.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/anonymousFunAsLastExpressionInBlock.fir.kt @@ -37,7 +37,7 @@ fun test() { y: Int -> fun(): Int {return 1} } - x4 checkType { _>>() } + x4 checkType { _>>() } { y: Int -> fun(): Int {return 1} } } diff --git a/compiler/testData/diagnostics/tests/declarationChecks/namedFunAsLastExpressionInBlock.fir.kt b/compiler/testData/diagnostics/tests/declarationChecks/namedFunAsLastExpressionInBlock.fir.kt index 99b1a0e45f7..42202be3f09 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/namedFunAsLastExpressionInBlock.fir.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/namedFunAsLastExpressionInBlock.fir.kt @@ -42,7 +42,7 @@ fun test() { y: Int -> fun named12(): Int {return 1} } - x4 checkType { _>() } + x4 checkType { _>() } { y: Int -> fun named14(): Int {return 1} } val b = (fun named15(): Boolean { return true })() @@ -61,7 +61,7 @@ fun success() { run2 { fun named2() = 1 } val x = run { fun named3() = 1 } - x checkType { _() } + x checkType { _() } val y = when (1) { 0 -> { @@ -71,5 +71,5 @@ fun success() { fun named5(): Int {return 1} } } - y checkType { _() } + y checkType { _() } } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/noExpectedType.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/noExpectedType.fir.kt index 6fb33e99ee2..3b39223d348 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/noExpectedType.fir.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/noExpectedType.fir.kt @@ -9,24 +9,24 @@ fun bar() { b checkType { _() } } - x checkType { _<(A) -> Unit>() } + x checkType { _<(A) -> Unit>() } val y = { (a: Int, b): A -> - a checkType { _() } + a checkType { _() } b checkType { _() } } - y checkType { _<(A) -> Unit>() } + y checkType { _<(A) -> Unit>() } val y2 = { (a: Number, b): A -> - a checkType { _() } + a checkType { _() } b checkType { _() } } - y2 checkType { _<(A) -> Unit>() } + y2 checkType { _<(A) -> Unit>() } val z = { (a: Int, b: String) -> - a checkType { _() } - b checkType { _() } + a checkType { _() } + b checkType { _() } } } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/functionLIteralInBlockInIf.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/functionLIteralInBlockInIf.fir.kt deleted file mode 100644 index dbb2f2e3c3f..00000000000 --- a/compiler/testData/diagnostics/tests/functionLiterals/functionLIteralInBlockInIf.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// !CHECK_TYPE -fun test() { - val a = if (true) { - val x = 1 - ({ x }) - } else { - { 2 } - } - a checkType { _<() -> Int>() } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionLiterals/functionLIteralInBlockInIf.kt b/compiler/testData/diagnostics/tests/functionLiterals/functionLIteralInBlockInIf.kt index 678ab68bc0c..ecd3cea9b2b 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/functionLIteralInBlockInIf.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/functionLIteralInBlockInIf.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE fun test() { val a = if (true) { diff --git a/compiler/testData/diagnostics/tests/functionLiterals/functionLiteralWithoutArgumentList.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/functionLiteralWithoutArgumentList.fir.kt deleted file mode 100644 index 4ff47f19893..00000000000 --- a/compiler/testData/diagnostics/tests/functionLiterals/functionLiteralWithoutArgumentList.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -// !CHECK_TYPE -fun id(t: T) = t - -fun foo() { - val i = id { 22 } //type inference error: no information for parameter - i checkType { _<()->Int>() } -} diff --git a/compiler/testData/diagnostics/tests/functionLiterals/functionLiteralWithoutArgumentList.kt b/compiler/testData/diagnostics/tests/functionLiterals/functionLiteralWithoutArgumentList.kt index ac3e89990a2..3522938e5d4 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/functionLiteralWithoutArgumentList.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/functionLiteralWithoutArgumentList.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE fun id(t: T) = t diff --git a/compiler/testData/diagnostics/tests/generics/doNotCaptureSupertype.fir.kt b/compiler/testData/diagnostics/tests/generics/doNotCaptureSupertype.fir.kt deleted file mode 100644 index 8c96719d74b..00000000000 --- a/compiler/testData/diagnostics/tests/generics/doNotCaptureSupertype.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// !CHECK_TYPE -// SKIP_TXT -fun test(b: S) { - b.collect(toList()) checkType { _>() } -} - -interface S { - fun collect(collector: C): R -} - -class C - -fun toList(): C> = null!! - -class Inv diff --git a/compiler/testData/diagnostics/tests/generics/doNotCaptureSupertype.kt b/compiler/testData/diagnostics/tests/generics/doNotCaptureSupertype.kt index 6f32d24fe2a..eeca507a60e 100644 --- a/compiler/testData/diagnostics/tests/generics/doNotCaptureSupertype.kt +++ b/compiler/testData/diagnostics/tests/generics/doNotCaptureSupertype.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // SKIP_TXT fun test(b: S) { diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClasses.fir.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClasses.fir.kt index 581059db154..a8fa7ce8835 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClasses.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClasses.fir.kt @@ -19,8 +19,8 @@ class A : Outer() { } fun foo() { - Derived().foo() checkType { _.Inner>() } + Derived().foo() checkType { _.Inner>() } Derived().baz() checkType { _>() } - A.B().bar() checkType { _.Inner>() } + A.B().bar() checkType { _.Inner>() } A.B().x() checkType { _>() } } diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocal.fir.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocal.fir.kt index 95c97c0dfd3..ffd67e920ab 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocal.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocal.fir.kt @@ -42,7 +42,7 @@ fun test() { var x = foobar() x = foobar() - x().foo().a() checkType { _>() } + x().foo().a() checkType { _>() } x().bar() checkType { _>() } x = foobar() @@ -50,6 +50,6 @@ fun test() { var y = noParameters() y = noParameters() - y().foo().a() checkType { _>() } + y().foo().a() checkType { _>() } y().bar() checkType { _>() } } diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesTransitive.fir.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesTransitive.fir.kt index 56cb5e609c8..44702eb782f 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesTransitive.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesTransitive.fir.kt @@ -14,6 +14,6 @@ class Derived : BaseDerived2() { } fun foo() { - Derived().foo() checkType { _.Inner>() } + Derived().foo() checkType { _.Inner>() } Derived().baz() checkType { _>() } } diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/secondLevelDepth.fir.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/secondLevelDepth.fir.kt index e5f856332b7..289136efa64 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/secondLevelDepth.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/secondLevelDepth.fir.kt @@ -14,5 +14,5 @@ class DerivedOuter : Outer() { } fun foo() { - DerivedOuter().DerivedInner().foo() checkType { _.Inner.Inner2>() } + DerivedOuter().DerivedInner().foo() checkType { _.Inner.Inner2>() } } diff --git a/compiler/testData/diagnostics/tests/generics/kt9985.fir.kt b/compiler/testData/diagnostics/tests/generics/kt9985.fir.kt index 6af3f78e7e7..7be3088b3d8 100644 --- a/compiler/testData/diagnostics/tests/generics/kt9985.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/kt9985.fir.kt @@ -24,23 +24,23 @@ fun B.bar() = "" fun foo(l: A?) { // No errors should be here - foo(l?.bar()) checkType { _() } - foo(l?.gav()) checkType { _() } + foo(l?.bar()) checkType { _() } + foo(l?.gav()) checkType { _() } if (l != null) { - foo(l?.bar()) checkType { _() } - foo(l?.gav()) checkType { _() } + foo(l?.bar()) checkType { _() } + foo(l?.gav()) checkType { _() } } } fun fooNotNull(l: A) { // No errors should be here - foo(l?.bar()) checkType { _() } - foo(l?.gav()) checkType { _() } + foo(l?.bar()) checkType { _() } + foo(l?.gav()) checkType { _() } } fun bar() { val l = B.create() - foo(l?.bar()) checkType { _() } - foo(l?.gav()) checkType { _() } + foo(l?.bar()) checkType { _() } + foo(l?.gav()) checkType { _() } } diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/MLOut.fir.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/MLOut.fir.kt deleted file mode 100644 index 082106edebe..00000000000 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/MLOut.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// !CHECK_TYPE - -// FILE: A.java -public class A { - public java.util.List foo() {} -} - -// FILE: main.kt - -fun foo2(x: A, y: MutableList) { - x.foo().isEmpty() - x.foo().get(0) checkType { _() } - x.foo().iterator() checkType { _>() } - - y.isEmpty() - y.get(0) checkType { _() } - y.iterator() checkType { _>() } -} diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/MLOut.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/MLOut.kt index 8f573bce36f..df71a9b7c6e 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/MLOut.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/MLOut.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // FILE: A.java diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/approximateDispatchReceiver.fir.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/approximateDispatchReceiver.fir.kt deleted file mode 100644 index 7c3a4681b6b..00000000000 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/approximateDispatchReceiver.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// !CHECK_TYPE - -public abstract class A { - fun bar(): String = "" -} - -public class B : A>() - -fun test(b: B<*>) { - // Here `bar` could have dispatch receiver parameter type 'A>', but it wouldn't work as - // since 'b' has type 'A>', so we should approximate dispatch receiver PARAMETER type to make it accept original receiver - b.bar() - b.bar() checkType { _() } -} diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/approximateDispatchReceiver.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/approximateDispatchReceiver.kt index 3f8d756af45..f8e7989ba53 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/approximateDispatchReceiver.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/approximateDispatchReceiver.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE public abstract class A { diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/kt7296.fir.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/kt7296.fir.kt index c609458644b..0016cabdc19 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/kt7296.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/kt7296.fir.kt @@ -11,5 +11,5 @@ fun main() { val c : ListOfLists<*> = b val d : ArrayList> = c.x - c.x checkType { _>>() } + c.x checkType { _>>() } } diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/platformSuperClass.fir.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/platformSuperClass.fir.kt index f44f0a6ed53..88468010ca6 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/platformSuperClass.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/platformSuperClass.fir.kt @@ -9,12 +9,12 @@ public class Clazz { // FILE: main.kt fun test(clazz: Clazz<*>) { - clazz.t checkType { _() } - clazz.getSuperClass() checkType { _?>() } - clazz.getSuperClass().t checkType { _() } + clazz.t checkType { _() } + clazz.getSuperClass() checkType { _?>() } + clazz.getSuperClass().t checkType { _() } - clazz.superClass checkType { _?>() } - clazz.superClass.t checkType { _() } + clazz.superClass checkType { _?>() } + clazz.superClass.t checkType { _() } // See KT-9294 if (clazz.superClass == null) { diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/starNullability.fir.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/starNullability.fir.kt index a7fe4f6edc3..48265c7ce2f 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/starNullability.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/starNullability.fir.kt @@ -11,6 +11,6 @@ fun acceptA(a: A) { } fun main(i: I<*>) { - i.foo() checkType { _() } + i.foo() checkType { _() } acceptA(i.foo()) // i.foo() should be nullable but isn't } diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/starNullabilityRecursive.fir.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/starNullabilityRecursive.fir.kt index ed7aedae6a1..46a58ae16a9 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/starNullabilityRecursive.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/starNullabilityRecursive.fir.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/superClass.fir.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/superClass.fir.kt index e0963df5033..5ea9a64097d 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/superClass.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/superClass.fir.kt @@ -6,7 +6,7 @@ interface Clazz { } fun test(clazz: Clazz<*>) { - clazz.t checkType { _() } - clazz.getSuperClass() checkType { _>() } - clazz.getSuperClass().t checkType { _() } + clazz.t checkType { _() } + clazz.getSuperClass() checkType { _>() } + clazz.getSuperClass().t checkType { _() } } diff --git a/compiler/testData/diagnostics/tests/generics/starProjections/invalid.fir.kt b/compiler/testData/diagnostics/tests/generics/starProjections/invalid.fir.kt index 068e1c105b1..23be8a295d5 100644 --- a/compiler/testData/diagnostics/tests/generics/starProjections/invalid.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/starProjections/invalid.fir.kt @@ -13,9 +13,9 @@ class 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(null) diff --git a/compiler/testData/diagnostics/tests/generics/varProjection/setterNotProjectedOutAssign.fir.kt b/compiler/testData/diagnostics/tests/generics/varProjection/setterNotProjectedOutAssign.fir.kt index 9086a1fa476..0d4d739096a 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/generics/varProjection/setterProjectedOutAssign.fir.kt b/compiler/testData/diagnostics/tests/generics/varProjection/setterProjectedOutAssign.fir.kt index fedfb34f531..6812fed723e 100644 --- a/compiler/testData/diagnostics/tests/generics/varProjection/setterProjectedOutAssign.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/varProjection/setterProjectedOutAssign.fir.kt @@ -10,5 +10,5 @@ fun test(t: Tr<*>) { t.v = null!! t.v = "" t.v = null - t.v checkType { _() } + t.v checkType { _() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/captureForNullableTypes.fir.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/captureForNullableTypes.fir.kt index 019da0ed399..1f1c83f0fbf 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/captureForNullableTypes.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/captureForNullableTypes.fir.kt @@ -7,7 +7,7 @@ fun bar(a: Array): Array = null!! fun test1(a: Array) { val r: Array = bar(a) val t = bar(a) - t checkType { _>() } + t checkType { _>() } } fun foo(l: Array): Array> = null!! @@ -15,5 +15,5 @@ fun foo(l: Array): Array> = null!! fun test2(a: Array) { val r: Array> = foo(a) val t = foo(a) - t checkType { _>>() } + t checkType { _>>() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/captureForPlatformTypes.fir.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/captureForPlatformTypes.fir.kt deleted file mode 100644 index fe976e17094..00000000000 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/captureForPlatformTypes.fir.kt +++ /dev/null @@ -1,27 +0,0 @@ -// !CHECK_TYPE -// !DIAGNOSTICS: -UNUSED_VARIABLE -// FILE: A.java -public class A { - public static Class foo(Class clazz) { - return clazz; - } - - public static Class> bar(Class clazz) { - throw new Exception(); - } -} - -// FILE: b.kt -fun test1(clazz: Class) { - val foo0: Class = A.foo(clazz) - val foo1 = A.foo(clazz) - foo1 checkType { _< Class >() } - foo1 checkType { _< Class >() } -} - -fun tes2t(clazz: Class) { - val foo0: Class> = A.bar(clazz) - val foo1 = A.bar(clazz) - foo1 checkType { _< Class> >() } - foo1 checkType { _< Class> >() } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/captureForPlatformTypes.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/captureForPlatformTypes.kt index 6509c48e8f9..3ca38374720 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/captureForPlatformTypes.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/captureForPlatformTypes.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // !DIAGNOSTICS: -UNUSED_VARIABLE // FILE: A.java diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedType.fir.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedType.fir.kt deleted file mode 100644 index a032a30b87e..00000000000 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedType.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -// !CHECK_TYPE - -fun foo(array: Array): Array = array - -fun test1(a1: Array) { - val b1: Array = foo(a1) - val c1 = foo(a1) - c1 checkType { _>() } -} - -fun test2(a2: Array) { - val b2: Array = foo(a2) - val c2 = foo(a2) - c2 checkType { _>() } -} diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedType.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedType.kt index 1cee3fe84e8..7666c598f03 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedType.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER // !CHECK_TYPE diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedTypeAndApproximation.fir.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedTypeAndApproximation.fir.kt deleted file mode 100644 index b0cc77cfab5..00000000000 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedTypeAndApproximation.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -// !CHECK_TYPE - -fun foo(a: Array): Array> = throw Exception() - -fun test1(a1: Array) { - val b1: Array> = foo(a1) - val c1 = foo(a1) - c1 checkType { _>>() } -} - -fun test2(a2: Array) { - val b2: Array> = foo(a2) - val c2 = foo(a2) - c2 checkType { _>>() } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedTypeAndApproximation.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedTypeAndApproximation.kt index 42689ae47fb..0a5e17b3444 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedTypeAndApproximation.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedTypeAndApproximation.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER // !CHECK_TYPE diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedTypeSubstitutedIntoOppositeProjection.fir.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedTypeSubstitutedIntoOppositeProjection.fir.kt deleted file mode 100644 index 8d039702800..00000000000 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedTypeSubstitutedIntoOppositeProjection.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -// !CHECK_TYPE - -fun foo1(a1: Array, a2: Array): T = null!! - -fun test1(a1: Array, a2: Array) { - foo1(a1, a2) checkType { _() } -} - -fun foo2(a1: Array, a2: Array): T = null!! - -fun test2(a1: Array, a2: Array) { - foo2(a1, a2) checkType { _() } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedTypeSubstitutedIntoOppositeProjection.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedTypeSubstitutedIntoOppositeProjection.kt index 42a2080473b..48590465f11 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedTypeSubstitutedIntoOppositeProjection.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedTypeSubstitutedIntoOppositeProjection.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER // !CHECK_TYPE diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/kt2570.fir.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/kt2570.fir.kt deleted file mode 100644 index 505d3dbbefa..00000000000 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/kt2570.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// !CHECK_TYPE -// !DIAGNOSTICS: -UNUSED_VARIABLE - -fun foo(l: MutableList): MutableList = l -fun test(l: MutableList) { - val a: MutableList = foo(l) - val b = foo(l) - b checkType { _< MutableList >() } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/kt2570.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/kt2570.kt index 30e3508c4fb..edd7c1b47d8 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/kt2570.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/kt2570.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // !DIAGNOSTICS: -UNUSED_VARIABLE diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/memberScopeOfCaptured.fir.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/memberScopeOfCaptured.fir.kt index c09a56415ba..ec3e58cb823 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/memberScopeOfCaptured.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/memberScopeOfCaptured.fir.kt @@ -7,6 +7,6 @@ class A { fun A.bar(): A = this fun baz(x: A) { - x.bar() checkType { _>() } - x.bar().foo() checkType { _() } // See KT-10448 + x.bar() checkType { _>() } + x.bar().foo() checkType { _() } // See KT-10448 } diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/overApproximationForInCaptured.fir.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/overApproximationForInCaptured.fir.kt deleted file mode 100644 index b14d2498fd2..00000000000 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/overApproximationForInCaptured.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -// !CHECK_TYPE - -fun foo(a: Array): T = null!! - -fun test(a: Array) { - foo(a) checkType { _() } -} diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/overApproximationForInCaptured.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/overApproximationForInCaptured.kt index 5d69f03f96e..63259b2b7b8 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/overApproximationForInCaptured.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/overApproximationForInCaptured.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER // !CHECK_TYPE diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/overApproximationForOutCaptured.fir.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/overApproximationForOutCaptured.fir.kt deleted file mode 100644 index 9c9fa4e59fa..00000000000 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/overApproximationForOutCaptured.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -// !CHECK_TYPE - -fun foo(a: Array): T = null!! - -fun test(a: Array) { - foo(a) checkType { _() } -} diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/overApproximationForOutCaptured.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/overApproximationForOutCaptured.kt index 33a5f8da396..859ab7b5b8a 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/overApproximationForOutCaptured.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/overApproximationForOutCaptured.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER // !CHECK_TYPE diff --git a/compiler/testData/diagnostics/tests/inference/coercionToUnit/noCoercion.fir.kt b/compiler/testData/diagnostics/tests/inference/coercionToUnit/noCoercion.fir.kt index 25ebd6d5781..655898ee233 100644 --- a/compiler/testData/diagnostics/tests/inference/coercionToUnit/noCoercion.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/coercionToUnit/noCoercion.fir.kt @@ -6,7 +6,7 @@ fun noCoercionLastExpressionUsedAsReturnArgument() { 42 } - a checkType { _<() -> Int>() } + a checkType { _<() -> Int>() } } fun noCoercionBlockHasExplicitType() { diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/kt3372toCollection.fir.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/kt3372toCollection.fir.kt deleted file mode 100644 index 18cd4edb8d4..00000000000 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/kt3372toCollection.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -// !CHECK_TYPE -// KT-3372 Use upper bound in type argument inference - -import java.util.HashSet - -fun > Iterable.toCollection(result: C) : C = throw Exception() - -fun test(list: List) { - val set = list.toCollection(HashSet()) - set checkType { _>() } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/kt3372toCollection.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/kt3372toCollection.kt index ea1f2c3b8de..f52fae489e4 100644 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/kt3372toCollection.kt +++ b/compiler/testData/diagnostics/tests/inference/commonSystem/kt3372toCollection.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER // !CHECK_TYPE // KT-3372 Use upper bound in type argument inference diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/nestedLambdas.fir.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/nestedLambdas.fir.kt deleted file mode 100644 index 3e81b84763c..00000000000 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/nestedLambdas.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -// !CHECK_TYPE - -fun Collection.map(transform : (T) -> R) : List = throw Exception() - -fun test(list: List>) { - - val list1 = list.map { it.map { "$it" } } - list1 checkType { _>>() } -} diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/nestedLambdas.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/nestedLambdas.kt index 636000acb4c..09b52c4b2d9 100644 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/nestedLambdas.kt +++ b/compiler/testData/diagnostics/tests/inference/commonSystem/nestedLambdas.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER // !CHECK_TYPE diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/theSameFunctionInArgs.fir.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/theSameFunctionInArgs.fir.kt deleted file mode 100644 index 87ce95e3651..00000000000 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/theSameFunctionInArgs.fir.kt +++ /dev/null @@ -1,6 +0,0 @@ -// !CHECK_TYPE - -fun test() { - val array = arrayOf(arrayOf(1)) - array checkType { _>>() } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/theSameFunctionInArgs.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/theSameFunctionInArgs.kt index ee5966fe5f2..0e544da05bc 100644 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/theSameFunctionInArgs.kt +++ b/compiler/testData/diagnostics/tests/inference/commonSystem/theSameFunctionInArgs.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE fun test() { diff --git a/compiler/testData/diagnostics/tests/inference/completion/nothingFromNestedCall.fir.kt b/compiler/testData/diagnostics/tests/inference/completion/nothingFromNestedCall.fir.kt index e97e31bbaf8..2319bd65e03 100644 --- a/compiler/testData/diagnostics/tests/inference/completion/nothingFromNestedCall.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/completion/nothingFromNestedCall.fir.kt @@ -9,5 +9,5 @@ fun invOut(y: K?): Inv> = TODO() fun test(x: Inv>): R = TODO() fun testNothing() { - test(invOut(null)) checkType { _() } + test(invOut(null)) checkType { _() } } diff --git a/compiler/testData/diagnostics/tests/inference/constraints/equalityConstraintOnNullableType.fir.kt b/compiler/testData/diagnostics/tests/inference/constraints/equalityConstraintOnNullableType.fir.kt deleted file mode 100644 index c9e1f3c8eab..00000000000 --- a/compiler/testData/diagnostics/tests/inference/constraints/equalityConstraintOnNullableType.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// !CHECK_TYPE -interface A - -fun foo(a: A, aN: A): T = throw Exception("$a $aN") - -fun doA(a: A): T = throw Exception("$a") - -fun test(a: A, aN: A) { - val aa = doA(aN) - aa checkType { _() } - - val nullable = foo(aN, aN) - //T = Int?, T? = Int? => T = Int? - nullable checkType { _() } - - val notNullable = foo(a, aN) - //T = Int, T? = Int? => T = Int - notNullable checkType { _() } -} diff --git a/compiler/testData/diagnostics/tests/inference/constraints/equalityConstraintOnNullableType.kt b/compiler/testData/diagnostics/tests/inference/constraints/equalityConstraintOnNullableType.kt index 152242d6392..26f5b6971d7 100644 --- a/compiler/testData/diagnostics/tests/inference/constraints/equalityConstraintOnNullableType.kt +++ b/compiler/testData/diagnostics/tests/inference/constraints/equalityConstraintOnNullableType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE interface A diff --git a/compiler/testData/diagnostics/tests/inference/constraints/notNullConstraintOnNullableType.fir.kt b/compiler/testData/diagnostics/tests/inference/constraints/notNullConstraintOnNullableType.fir.kt index ac3cc49aa4f..2d90e788e21 100644 --- a/compiler/testData/diagnostics/tests/inference/constraints/notNullConstraintOnNullableType.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/constraints/notNullConstraintOnNullableType.fir.kt @@ -15,7 +15,7 @@ fun test(out: Out, i: In, inv: A) { // T? >: Int => T = Int doT(1) val r = doOut(out) - r checkType { _() } + r checkType { _() } // T? <: Int => error doIn(i) diff --git a/compiler/testData/diagnostics/tests/inference/constraints/subtypeConstraintOnNullableType.fir.kt b/compiler/testData/diagnostics/tests/inference/constraints/subtypeConstraintOnNullableType.fir.kt deleted file mode 100644 index a4459ec1777..00000000000 --- a/compiler/testData/diagnostics/tests/inference/constraints/subtypeConstraintOnNullableType.fir.kt +++ /dev/null @@ -1,22 +0,0 @@ -// !CHECK_TYPE -interface A - -interface Out - -fun foo(a: A, o: Out): T = throw Exception("$a $o") - -fun doOut(o: Out): T = throw Exception("$o") - -fun test(a: A, aN: A, o: Out) { - val out = doOut(o) - //T? >: Int? => T >: Int - out checkType { _() } - - val nullable = foo(aN, o) - //T = Int?, T? >: Int? => T = Int? - nullable checkType { _() } - - val notNullable = foo(a, o) - //T = Int, T? >: Int? => T = Int - notNullable checkType { _() } -} diff --git a/compiler/testData/diagnostics/tests/inference/constraints/subtypeConstraintOnNullableType.kt b/compiler/testData/diagnostics/tests/inference/constraints/subtypeConstraintOnNullableType.kt index 59d59410736..f21457943ca 100644 --- a/compiler/testData/diagnostics/tests/inference/constraints/subtypeConstraintOnNullableType.kt +++ b/compiler/testData/diagnostics/tests/inference/constraints/subtypeConstraintOnNullableType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE interface A diff --git a/compiler/testData/diagnostics/tests/inference/constraints/supertypeConstraintOnNullableType.fir.kt b/compiler/testData/diagnostics/tests/inference/constraints/supertypeConstraintOnNullableType.fir.kt deleted file mode 100644 index 8eecd698e16..00000000000 --- a/compiler/testData/diagnostics/tests/inference/constraints/supertypeConstraintOnNullableType.fir.kt +++ /dev/null @@ -1,22 +0,0 @@ -// !CHECK_TYPE -interface A - -interface In - -fun foo(a: A, i: In): T = throw Exception("$a $i") - -fun doIn(i: In): T = throw Exception("$i") - -fun test(a: A, aN: A, i: In) { - val _in = doIn(i) - //T? <: Int? => T <: Int? - _in checkType { _() } - - val notNullable = foo(a, i) - //T = Int, T? <: Int? => T = Int - notNullable checkType { _() } - - val nullable = foo(aN, i) - //T = Int?, T? <: Int? => T = Int? - nullable checkType { _() } -} diff --git a/compiler/testData/diagnostics/tests/inference/constraints/supertypeConstraintOnNullableType.kt b/compiler/testData/diagnostics/tests/inference/constraints/supertypeConstraintOnNullableType.kt index c6689046e89..90b401bfa05 100644 --- a/compiler/testData/diagnostics/tests/inference/constraints/supertypeConstraintOnNullableType.kt +++ b/compiler/testData/diagnostics/tests/inference/constraints/supertypeConstraintOnNullableType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE interface A diff --git a/compiler/testData/diagnostics/tests/inference/implicitInvokeExtensionWithFunctionalArgument.fir.kt b/compiler/testData/diagnostics/tests/inference/implicitInvokeExtensionWithFunctionalArgument.fir.kt index 9dad1baf906..8d7337641a6 100644 --- a/compiler/testData/diagnostics/tests/inference/implicitInvokeExtensionWithFunctionalArgument.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/implicitInvokeExtensionWithFunctionalArgument.fir.kt @@ -11,19 +11,19 @@ class State(val p1: Double, val p2: () -> Int, val p3: String?) fun test(s: SelectorFor): Double { val a = s { p1 } - a checkType { _>() } + a checkType { _>() } val b = s { p2 } - b checkType { _ Int>>()} + b checkType { _ Int>>()} val c = s { p3 } - c checkType { _>() } + c checkType { _>() } val d = s { } - d checkType { _>() } + d checkType { _>() } val e = s { return p1 } - e checkType { _>() } + e checkType { _>() } return null!! } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/implicitInvokeInCompanionObjectWithFunctionalArgument.fir.kt b/compiler/testData/diagnostics/tests/inference/implicitInvokeInCompanionObjectWithFunctionalArgument.fir.kt index 6335fc1b530..46da8700d06 100644 --- a/compiler/testData/diagnostics/tests/inference/implicitInvokeInCompanionObjectWithFunctionalArgument.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/implicitInvokeInCompanionObjectWithFunctionalArgument.fir.kt @@ -10,8 +10,8 @@ class TestClass { fun test(s: String): String { val a = TestClass { "K" } - a checkType { _() } + a checkType { _() } val b = TestClass { return s } - b checkType { _() } + b checkType { _() } } diff --git a/compiler/testData/diagnostics/tests/inference/implicitInvokeInObjectWithFunctionalArgument.fir.kt b/compiler/testData/diagnostics/tests/inference/implicitInvokeInObjectWithFunctionalArgument.fir.kt index 9b445a43789..cd227b70b35 100644 --- a/compiler/testData/diagnostics/tests/inference/implicitInvokeInObjectWithFunctionalArgument.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/implicitInvokeInObjectWithFunctionalArgument.fir.kt @@ -8,8 +8,8 @@ object TestClass { fun test(s: String): String { val a = TestClass { TestClass { TestClass } } - a checkType { _() } + 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.fir.kt b/compiler/testData/diagnostics/tests/inference/implicitInvokeWithFunctionLiteralArgument.fir.kt index cc6a8ce84ff..7975f090869 100644 --- a/compiler/testData/diagnostics/tests/inference/implicitInvokeWithFunctionLiteralArgument.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/implicitInvokeWithFunctionLiteralArgument.fir.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 } @@ -23,13 +23,13 @@ interface FutureCallback { fun test(cb: FutureCallback) { val a = cb { it[0] } - a checkType { _>() } + a checkType { _>() } val b = cb { it } - b checkType { _>() } + b checkType { _>() } val c = cb {} - c checkType { _>() } + c checkType { _>() } cb.let { callback -> val d = callback { it.length } diff --git a/compiler/testData/diagnostics/tests/inference/kt30405.fir.kt b/compiler/testData/diagnostics/tests/inference/kt30405.fir.kt deleted file mode 100644 index b769cf1ff57..00000000000 --- a/compiler/testData/diagnostics/tests/inference/kt30405.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// !WITH_NEW_INFERENCE -// !LANGUAGE: +ExpectedTypeFromCast -// !CHECK_TYPE -// Issue: KT-30405 - -inline fun foo(): T { - TODO() -} - -fun test() { - val fooCall = foo() as String // T in foo should be inferred to String - fooCall checkType { _() } - - val safeFooCall = foo() as? String - safeFooCall checkType { _() } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/kt30405.kt b/compiler/testData/diagnostics/tests/inference/kt30405.kt index c618fc45235..eeb542cd06c 100644 --- a/compiler/testData/diagnostics/tests/inference/kt30405.kt +++ b/compiler/testData/diagnostics/tests/inference/kt30405.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !WITH_NEW_INFERENCE // !LANGUAGE: +ExpectedTypeFromCast // !CHECK_TYPE diff --git a/compiler/testData/diagnostics/tests/inference/nothingType/notEnoughInformationAndNothing.fir.kt b/compiler/testData/diagnostics/tests/inference/nothingType/notEnoughInformationAndNothing.fir.kt index 3e58c6b661b..988a99029ca 100644 --- a/compiler/testData/diagnostics/tests/inference/nothingType/notEnoughInformationAndNothing.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/nothingType/notEnoughInformationAndNothing.fir.kt @@ -13,7 +13,7 @@ fun test1(b: Boolean?) { false -> null null -> materialize() } - v checkType { _?>() } + v checkType { _?>() } } fun test2() { diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2754.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2754.fir.kt deleted file mode 100644 index 3fb056c4e15..00000000000 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2754.fir.kt +++ /dev/null @@ -1,28 +0,0 @@ -// !CHECK_TYPE -// !DIAGNOSTICS: -UNUSED_PARAMETER - -// T is the immutable type -interface Builder { - fun build(): T -} - -// T is the immutable type, U is the builder -interface Copyable> { - fun builder(): U -} - -fun , U : Builder> T.copy(fn: U.() -> Unit): T = throw Exception() - -open class Foo(val x: Int, val y: Int) : Copyable { - override fun builder(): FooBuilder = FooBuilder(x, y) - - open class FooBuilder(var x: Int, var y: Int): Builder { - override fun build(): Foo = Foo(x, y) - } -} - -fun test() { - val foo1 = Foo(x = 1, y = 2) - val foo2 = foo1.copy { y = 3 } // this doesn't work - foo2 checkType { _() } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2754.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2754.kt index 6b5394796c3..2f773dece20 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2754.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2754.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt4420.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt4420.fir.kt deleted file mode 100644 index 8952e6ff724..00000000000 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt4420.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// !CHECK_TYPE -//KT-4420 Type inference with type projections - -class Foo -fun Foo.bar(): T = throw Exception() - -fun main() { - val f: Foo = Foo() - f.bar() checkType { _() } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt4420.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt4420.kt index 52a57a5ffbf..43548e6a3db 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt4420.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt4420.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE //KT-4420 Type inference with type projections diff --git a/compiler/testData/diagnostics/tests/inference/upperBounds/conflictingSubstitutionsFromUpperBound.fir.kt b/compiler/testData/diagnostics/tests/inference/upperBounds/conflictingSubstitutionsFromUpperBound.fir.kt deleted file mode 100644 index 5f534de1211..00000000000 --- a/compiler/testData/diagnostics/tests/inference/upperBounds/conflictingSubstitutionsFromUpperBound.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !CHECK_TYPE - -package g - -import java.util.HashSet -fun > convert(src: Collection, dest: C): C = throw Exception("$src $dest") - -fun test(l: List) { - //todo should be inferred - val r = convert(l, HashSet()) - r checkType { _>() } -} diff --git a/compiler/testData/diagnostics/tests/inference/upperBounds/conflictingSubstitutionsFromUpperBound.kt b/compiler/testData/diagnostics/tests/inference/upperBounds/conflictingSubstitutionsFromUpperBound.kt index 0fe2041a8e8..b3631d69542 100644 --- a/compiler/testData/diagnostics/tests/inference/upperBounds/conflictingSubstitutionsFromUpperBound.kt +++ b/compiler/testData/diagnostics/tests/inference/upperBounds/conflictingSubstitutionsFromUpperBound.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE package g diff --git a/compiler/testData/diagnostics/tests/inference/upperBounds/typeParameterAsUpperBound.fir.kt b/compiler/testData/diagnostics/tests/inference/upperBounds/typeParameterAsUpperBound.fir.kt index a88eaaa611f..70c58e281c2 100644 --- a/compiler/testData/diagnostics/tests/inference/upperBounds/typeParameterAsUpperBound.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/upperBounds/typeParameterAsUpperBound.fir.kt @@ -9,8 +9,8 @@ public fun listOf(t: T): List = TODO() fun usage(c: List) { val cn = c.ifEmpty { null } - cn checkType { _?>() } + cn checkType { _?>() } val cs = c.ifEmpty { listOf("x") } - cs checkType { _>() } + cs checkType { _>() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inner/extensionLambdaInsideNestedClass.fir.kt b/compiler/testData/diagnostics/tests/inner/extensionLambdaInsideNestedClass.fir.kt index 0c6e0e544ac..a062b91dc38 100644 --- a/compiler/testData/diagnostics/tests/inner/extensionLambdaInsideNestedClass.fir.kt +++ b/compiler/testData/diagnostics/tests/inner/extensionLambdaInsideNestedClass.fir.kt @@ -2,20 +2,20 @@ package f object A { class LoginFormPage() : Request({ - val failed = session.get("LOGIN_FAILED") + val failed = session.get("LOGIN_FAILED") }) } class B { companion object { class LoginFormPage() : Request({ - val failed = session.get("LOGIN_FAILED") + val failed = session.get("LOGIN_FAILED") }) } class C { class LoginFormPage() : Request({ - val failed = session.get("LOGIN_FAILED") + val failed = session.get("LOGIN_FAILED") }) } } diff --git a/compiler/testData/diagnostics/tests/j+k/arrayOfStarParametrized.fir.kt b/compiler/testData/diagnostics/tests/j+k/arrayOfStarParametrized.fir.kt index d18fda6e7fe..cf3299ac494 100644 --- a/compiler/testData/diagnostics/tests/j+k/arrayOfStarParametrized.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/arrayOfStarParametrized.fir.kt @@ -10,5 +10,5 @@ public class A { fun foo1(x: A<*>) = x.baz() fun foo2(x: A<*>) { - x.baz() checkType { _>>() } + x.baz() checkType { _>>() } } diff --git a/compiler/testData/diagnostics/tests/j+k/collectorInference.fir.kt b/compiler/testData/diagnostics/tests/j+k/collectorInference.fir.kt deleted file mode 100644 index b39362a17a7..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/collectorInference.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// !WITH_NEW_INFERENCE -// !CHECK_TYPE -// SKIP_TXT -// FULL_JDK - -import java.util.stream.Collectors -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 { _>() } -} - diff --git a/compiler/testData/diagnostics/tests/j+k/collectorInference.kt b/compiler/testData/diagnostics/tests/j+k/collectorInference.kt index 75e51dc97ec..4cf347e6fb1 100644 --- a/compiler/testData/diagnostics/tests/j+k/collectorInference.kt +++ b/compiler/testData/diagnostics/tests/j+k/collectorInference.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !WITH_NEW_INFERENCE // !CHECK_TYPE // SKIP_TXT diff --git a/compiler/testData/diagnostics/tests/j+k/genericConstructor/classTypeParameterInferredFromArgument.fir.kt b/compiler/testData/diagnostics/tests/j+k/genericConstructor/classTypeParameterInferredFromArgument.fir.kt index bab46b386aa..1042d4ef213 100644 --- a/compiler/testData/diagnostics/tests/j+k/genericConstructor/classTypeParameterInferredFromArgument.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/genericConstructor/classTypeParameterInferredFromArgument.fir.kt @@ -9,8 +9,8 @@ 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("", y) diff --git a/compiler/testData/diagnostics/tests/j+k/genericConstructor/innerClass.fir.kt b/compiler/testData/diagnostics/tests/j+k/genericConstructor/innerClass.fir.kt index 7dc1379b776..0e66f764eab 100644 --- a/compiler/testData/diagnostics/tests/j+k/genericConstructor/innerClass.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/genericConstructor/innerClass.fir.kt @@ -10,9 +10,9 @@ public class Outer { // FILE: main.kt fun test(x: List, y: List) { - Outer().Inner("", y, 1) checkType { _.Inner>() } + Outer().Inner("", y, 1) checkType { _.Inner>() } Outer().Inner("", y, 1) checkType { _.Inner>() } - Outer().Inner("", x, 1) checkType { _.Inner>() } + Outer().Inner("", x, 1) checkType { _.Inner>() } Outer().Inner("", x, 1) } diff --git a/compiler/testData/diagnostics/tests/j+k/kt36856.fir.kt b/compiler/testData/diagnostics/tests/j+k/kt36856.fir.kt index 7bd185c421e..3be6d64511f 100644 --- a/compiler/testData/diagnostics/tests/j+k/kt36856.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/kt36856.fir.kt @@ -14,6 +14,6 @@ class Foo fun main(foo1: Foo, foo2: Foo) { val x = object : Test() {} // FE exception is thrown here - x.with(foo1) checkType { _() } - x.with(foo2) checkType { _() } + x.with(foo1) checkType { _() } + x.with(foo2) checkType { _() } } diff --git a/compiler/testData/diagnostics/tests/j+k/wrongVarianceInJava.fir.kt b/compiler/testData/diagnostics/tests/j+k/wrongVarianceInJava.fir.kt index f9f04ca3148..51c01f1e910 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.foo().x() checkType { _() } A.bar().y(null) } diff --git a/compiler/testData/diagnostics/tests/numbers/numbersInSimpleConstraints.fir.kt b/compiler/testData/diagnostics/tests/numbers/numbersInSimpleConstraints.fir.kt index 4058881faf7..ccb9320dfbe 100644 --- a/compiler/testData/diagnostics/tests/numbers/numbersInSimpleConstraints.fir.kt +++ b/compiler/testData/diagnostics/tests/numbers/numbersInSimpleConstraints.fir.kt @@ -21,7 +21,7 @@ fun test() { checkSubtype(d) val e = id(9223372036854775807) - e checkType { _() } + e checkType { _() } val f: Byte = either(1, 2) @@ -32,7 +32,7 @@ fun test() { otherGeneric(1) val r = either(1, "") - r checkType { _() } + r checkType { _() } use(a, b, c, d, e, f, g, r) } @@ -48,7 +48,7 @@ fun testExactBound(invS: Inv, invI: Inv, invB: Inv) { exactBound(1, invI) val b = exactBound(1, invB) - b checkType { _() } + b checkType { _() } } interface Cov @@ -57,10 +57,10 @@ 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 { _() } + n checkType { _() } } interface Contr @@ -71,8 +71,8 @@ fun testUpperBound(contrS: Contr, contrB: Contr, contrN: ContrupperBound(1, contrS) val n = upperBound(1, contrN) - n checkType { _() } + n checkType { _() } val b = upperBound(1, contrB) - b checkType { _() } + b checkType { _() } } diff --git a/compiler/testData/diagnostics/tests/overload/defaultParameters.fir.kt b/compiler/testData/diagnostics/tests/overload/defaultParameters.fir.kt index 1a28b795288..c4b41b2f79e 100644 --- a/compiler/testData/diagnostics/tests/overload/defaultParameters.fir.kt +++ b/compiler/testData/diagnostics/tests/overload/defaultParameters.fir.kt @@ -28,28 +28,28 @@ fun wrong(a: String = "", b: Int = 1) {} fun test() { val a = simple() - a checkType { _() } + a checkType { _() } val b = simple(1) - b checkType { _() } + b checkType { _() } val c = twoDefault() - c checkType { _() } + c checkType { _() } val d = twoDefault(1) - d checkType { _() } + d checkType { _() } val e = twoDefault(1, "") - e checkType { _() } + e checkType { _() } val f = withGeneric(3) - f checkType { _() } + f checkType { _() } val g = discriminateGeneric(1) - g checkType { _() } + g checkType { _() } val h = withDefaultGeneric("") - h checkType { _() } + h checkType { _() } withDefaults(1) diff --git a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/withNothing.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/withNothing.fir.kt index 83c5ac36b0a..739c9e166f4 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/withNothing.fir.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/withNothing.fir.kt @@ -22,6 +22,6 @@ 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 { _>() } + v checkType { _>() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/inference.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/inference.fir.kt deleted file mode 100644 index ea06d3c395c..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/inference.fir.kt +++ /dev/null @@ -1,25 +0,0 @@ -// !CHECK_TYPE - -// FILE: foo/Base.java - -package foo; - -public interface Base {} - -// FILE: foo/HS.java - -package foo; - -public class HS extends Base {} - -// FILE: k.kt - -import foo.*; - -fun > convert(src: HS, dest: C): C = throw Exception("$src $dest") - -fun test(l: HS) { - //todo should be inferred - val r = convert(l, HS()) - r checkType { _>() } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/inference.kt b/compiler/testData/diagnostics/tests/platformTypes/inference.kt index f6818460b8b..07d7264c93a 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/inference.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/inference.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // FILE: foo/Base.java diff --git a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/explicitGetterType.fir.kt b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/explicitGetterType.fir.kt index 2e8bcf7bad6..3e5e552b101 100644 --- a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/explicitGetterType.fir.kt +++ b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/explicitGetterType.fir.kt @@ -12,7 +12,7 @@ fun bar(): List = null!! fun baz() { - x checkType { _() } - y checkType { _>() } - z checkType { _>() } + x checkType { _() } + y checkType { _>() } + z checkType { _>() } } diff --git a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/members.fir.kt b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/members.fir.kt index 59e36b0d91f..d755fd6ec1a 100644 --- a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/members.fir.kt +++ b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/members.fir.kt @@ -12,11 +12,11 @@ fun id(x: E) = x fun l(x: E): List = null!! fun foo(a: A) { - a.x checkType { _() } - a.y checkType { _() } - a.y2 checkType { _() } - a.z checkType { _>() } - a.z2 checkType { _>>() } + a.x checkType { _() } + a.y checkType { _() } + a.y2 checkType { _() } + a.z checkType { _>() } + a.z2 checkType { _>>() } with(a) { 1.u checkType { _() } diff --git a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/nullAsNothing.fir.kt b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/nullAsNothing.fir.kt index 0ac6589f0c1..d43acd3a5f7 100644 --- a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/nullAsNothing.fir.kt +++ b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/nullAsNothing.fir.kt @@ -4,6 +4,6 @@ val x get() = null val y get() = null!! fun foo() { - x checkType { _() } - y checkType { _() } + x checkType { _() } + y checkType { _() } } diff --git a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/overrides.fir.kt b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/overrides.fir.kt index c329821e32d..5fcf7b94f99 100644 --- a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/overrides.fir.kt +++ b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/overrides.fir.kt @@ -18,20 +18,20 @@ class C : B(), A { override var y get() = super.y set(value) { - value checkType { _() } + value checkType { _() } } override var z get() = "" set(value) { - value checkType { _() } + value checkType { _() } } } fun foo(c: C) { - c.x checkType { _() } - c.y checkType { _() } - c.z checkType { _() } + c.x checkType { _() } + c.y checkType { _() } + c.z checkType { _() } c.y = "" c.y = 1 diff --git a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/topLevel.fir.kt b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/topLevel.fir.kt index fee3f677993..a28d20cf58a 100644 --- a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/topLevel.fir.kt +++ b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/topLevel.fir.kt @@ -11,11 +11,11 @@ fun id(x: E) = x fun l(x: E): List = null!! fun foo() { - x checkType { _() } - y checkType { _() } - y2 checkType { _() } - z checkType { _>() } - z2 checkType { _>>() } + x checkType { _() } + y checkType { _() } + y2 checkType { _() } + z checkType { _>() } + z2 checkType { _>>() } - 1.u checkType { _() } + 1.u checkType { _() } } diff --git a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/vars.fir.kt b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/vars.fir.kt index d8e9261d7f7..8b45beb2913 100644 --- a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/vars.fir.kt +++ b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/vars.fir.kt @@ -2,7 +2,7 @@ var x get() = 1 set(q) { - q checkType { _() } + q checkType { _() } } var noSetter @@ -10,8 +10,8 @@ var noSetter fun foo() { - x checkType { _() } - noSetter checkType { _() } + x checkType { _() } + noSetter checkType { _() } x = 1 x = "" diff --git a/compiler/testData/diagnostics/tests/regressions/kt442.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt442.fir.kt index 0e1d3c624ef..acdf2880dc0 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt442.fir.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt442.fir.kt @@ -26,6 +26,6 @@ infix fun T.with(f : T.() -> Unit) { fun main() { val a = 1 with { - plus(1) + plus(1) } } diff --git a/compiler/testData/diagnostics/tests/resolve/inferenceInLinkedLambdas.fir.kt b/compiler/testData/diagnostics/tests/resolve/inferenceInLinkedLambdas.fir.kt deleted file mode 100644 index fd41b8a4972..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/inferenceInLinkedLambdas.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -// !CHECK_TYPE - -fun foo(first: () -> T, second: (T) -> R): R = throw Exception() -fun test() { - val r = foo( { 4 }, { "${it + 1}" } ) - r checkType { _() } -} diff --git a/compiler/testData/diagnostics/tests/resolve/inferenceInLinkedLambdas.kt b/compiler/testData/diagnostics/tests/resolve/inferenceInLinkedLambdas.kt index b6e7f1bc6dd..b7db8fc0528 100644 --- a/compiler/testData/diagnostics/tests/resolve/inferenceInLinkedLambdas.kt +++ b/compiler/testData/diagnostics/tests/resolve/inferenceInLinkedLambdas.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER // !CHECK_TYPE diff --git a/compiler/testData/diagnostics/tests/resolve/priority/kt10510.fir.kt b/compiler/testData/diagnostics/tests/resolve/priority/kt10510.fir.kt deleted file mode 100644 index 383c6940e68..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/priority/kt10510.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// !CHECK_TYPE -// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE - -class ClassA { - fun method1() = this - - fun String.method2() { - method1() checkType { _() } - this.method1() checkType { _() } - } -} - -fun String.method1() = this \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/priority/kt10510.kt b/compiler/testData/diagnostics/tests/resolve/priority/kt10510.kt index 3f37e2d061a..5793c8fdae4 100644 --- a/compiler/testData/diagnostics/tests/resolve/priority/kt10510.kt +++ b/compiler/testData/diagnostics/tests/resolve/priority/kt10510.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE diff --git a/compiler/testData/diagnostics/tests/resolve/priority/kt9965.fir.kt b/compiler/testData/diagnostics/tests/resolve/priority/kt9965.fir.kt deleted file mode 100644 index 0be29b963af..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/priority/kt9965.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -// !CHECK_TYPE -// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE - -enum class Foo { - FOO; - - companion object { - fun valueOf(something: String) = 2 - - fun values() = 1 - } -} - -fun test() { - Foo.values() checkType { _>() } - Foo.Companion.values() checkType { _() } - - Foo.valueOf("") checkType { _() } - Foo.Companion.valueOf("") checkType { _() } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/priority/kt9965.kt b/compiler/testData/diagnostics/tests/resolve/priority/kt9965.kt index 593d66c0c29..8a44af3b138 100644 --- a/compiler/testData/diagnostics/tests/resolve/priority/kt9965.kt +++ b/compiler/testData/diagnostics/tests/resolve/priority/kt9965.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE diff --git a/compiler/testData/diagnostics/tests/resolve/priority/localExtVsNonLocalExt.fir.kt b/compiler/testData/diagnostics/tests/resolve/priority/localExtVsNonLocalExt.fir.kt deleted file mode 100644 index f268f5f6600..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/priority/localExtVsNonLocalExt.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// !CHECK_TYPE -// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE - - -class A - -fun A.foo() = this - -fun test(a: A) { - fun A.foo() = 3 - - a.foo() checkType { _() } - with(a) { - foo() checkType { _() } - } -} diff --git a/compiler/testData/diagnostics/tests/resolve/priority/localExtVsNonLocalExt.kt b/compiler/testData/diagnostics/tests/resolve/priority/localExtVsNonLocalExt.kt index cfee1159917..803fc56e02d 100644 --- a/compiler/testData/diagnostics/tests/resolve/priority/localExtVsNonLocalExt.kt +++ b/compiler/testData/diagnostics/tests/resolve/priority/localExtVsNonLocalExt.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE diff --git a/compiler/testData/diagnostics/tests/resolve/priority/memberVsLocalExt.fir.kt b/compiler/testData/diagnostics/tests/resolve/priority/memberVsLocalExt.fir.kt index 1bd8872c5b0..4142abaa394 100644 --- a/compiler/testData/diagnostics/tests/resolve/priority/memberVsLocalExt.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/priority/memberVsLocalExt.fir.kt @@ -9,7 +9,7 @@ class A { fun test(a: A) { fun A.foo() = 4 - a.foo() checkType { _() } + a.foo() checkType { _() } with(a) { foo() checkType { _() } diff --git a/compiler/testData/diagnostics/tests/resolve/priority/staticVsImplicitReceiverMember.fir.kt b/compiler/testData/diagnostics/tests/resolve/priority/staticVsImplicitReceiverMember.fir.kt deleted file mode 100644 index 959f6d53415..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/priority/staticVsImplicitReceiverMember.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// !CHECK_TYPE -// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE - -// FILE: A.java -public class A { - public static void foo() {} -} - -// FILE: 1.kt - -class C { - fun foo() = this - - inner class B : A() { - fun test() { - foo() checkType { _() } - } - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/priority/staticVsImplicitReceiverMember.kt b/compiler/testData/diagnostics/tests/resolve/priority/staticVsImplicitReceiverMember.kt index 0d2b4d5060c..122901780e1 100644 --- a/compiler/testData/diagnostics/tests/resolve/priority/staticVsImplicitReceiverMember.kt +++ b/compiler/testData/diagnostics/tests/resolve/priority/staticVsImplicitReceiverMember.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE diff --git a/compiler/testData/diagnostics/tests/resolve/priority/synthesizedMembersVsExtension.fir.kt b/compiler/testData/diagnostics/tests/resolve/priority/synthesizedMembersVsExtension.fir.kt index 1e7e5cd98fc..1780db676c2 100644 --- a/compiler/testData/diagnostics/tests/resolve/priority/synthesizedMembersVsExtension.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/priority/synthesizedMembersVsExtension.fir.kt @@ -6,5 +6,5 @@ operator fun A.component1(): String = "" fun test(a: A) { val (b) = a - b checkType { _() } + b checkType { _() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/priority/syntheticPropertiesVsExtensions.fir.kt b/compiler/testData/diagnostics/tests/resolve/priority/syntheticPropertiesVsExtensions.fir.kt deleted file mode 100644 index 4ef52eb8488..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/priority/syntheticPropertiesVsExtensions.fir.kt +++ /dev/null @@ -1,29 +0,0 @@ -// !CHECK_TYPE -// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE - -// FILE: A.java -public class A { - public A getFoo() { return 3; } -} - -// FILE: 1.kt - -private val A.foo: Int get() = 4 - -fun test(a: A) { - a.foo checkType { _() } - with(a) { - foo checkType { _() } - } -} - -class B { - private val A.foo: B get() = this@B - - fun test(a: A) { - a.foo checkType { _() } - with(a) { - foo checkType { _() } - } - } -} diff --git a/compiler/testData/diagnostics/tests/resolve/priority/syntheticPropertiesVsExtensions.kt b/compiler/testData/diagnostics/tests/resolve/priority/syntheticPropertiesVsExtensions.kt index 4efbd0051f2..2965520b27e 100644 --- a/compiler/testData/diagnostics/tests/resolve/priority/syntheticPropertiesVsExtensions.kt +++ b/compiler/testData/diagnostics/tests/resolve/priority/syntheticPropertiesVsExtensions.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE diff --git a/compiler/testData/diagnostics/tests/samConversions/OverloadPriority.fir.kt b/compiler/testData/diagnostics/tests/samConversions/OverloadPriority.fir.kt index d89c9c184f1..08666e38507 100644 --- a/compiler/testData/diagnostics/tests/samConversions/OverloadPriority.fir.kt +++ b/compiler/testData/diagnostics/tests/samConversions/OverloadPriority.fir.kt @@ -27,5 +27,5 @@ fun test(j: J) { j.bas({ it checkType { _() }; "" }, "") checkType { _() } // NI: TODO - j.bar { it checkType { _() }; "" } checkType { _() } + j.bar { it checkType { _() }; "" } checkType { _() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/samConversions/OverloadPriorityKT.fir.kt b/compiler/testData/diagnostics/tests/samConversions/OverloadPriorityKT.fir.kt index a7eea3f18fe..9e798e39854 100644 --- a/compiler/testData/diagnostics/tests/samConversions/OverloadPriorityKT.fir.kt +++ b/compiler/testData/diagnostics/tests/samConversions/OverloadPriorityKT.fir.kt @@ -26,5 +26,5 @@ fun test(k: K) { k.bas { it checkType { _() }; "" } checkType { _() } // NI: TODO - k.bar { it checkType { _() }; "" } checkType { _() } + k.bar { it checkType { _() }; "" } checkType { _() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/inference/kt1275.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/inference/kt1275.fir.kt index 3e8b55e329b..879f4905bec 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/inference/kt1275.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/inference/kt1275.fir.kt @@ -4,8 +4,8 @@ fun foo(s : String?, b : Boolean) { if (s == null) return val s1 = if (b) "" else s - s1 checkType { _() } + s1 checkType { _() } val s2 = s - s2 checkType { _() } + s2 checkType { _() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/kt30927.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/kt30927.fir.kt index 9ae3e219581..c696612aea0 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/kt30927.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/kt30927.fir.kt @@ -8,8 +8,8 @@ fun case_0() { this as Int this // error in NI: required Int, found Any?; just inferred to Any? in OI } - y checkType { _() } - y checkType { _() } + y checkType { _() } + y checkType { _() } } fun case_1(z: Any?) { @@ -20,8 +20,8 @@ fun case_1(z: Any?) { else -> return@run "" } } - y checkType { _() } - y checkType { _() } + y checkType { _() } + y checkType { _() } // y is inferred to Any? } @@ -33,7 +33,7 @@ fun case_2(z: Any?) { else -> return@run "" } } - y checkType { _() } + y checkType { _() } // y is inferred to String } @@ -45,7 +45,7 @@ fun case_3(z: Any?) { else -> return@let "" } } - y checkType { _() } - y checkType { _() } + y checkType { _() } + y checkType { _() } // y is inferred to String } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolution.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolution.fir.kt index 26b40b35e3b..2f03f7e41dc 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolution.fir.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolution.fir.kt @@ -11,26 +11,26 @@ public class A { // FILE: 1.kt fun fn() {} fun x(a: A, r: Runnable) { - a.foo(::fn) checkType { _() } - a.foo {} checkType { _() } + a.foo(::fn) checkType { _() } + a.foo {} checkType { _() } - a.foo(null) checkType { _() } - a.foo(Runnable { }) checkType { _() } - a.foo(r) checkType { _() } + a.foo(null) checkType { _() } + a.foo(Runnable { }) checkType { _() } + a.foo(r) checkType { _() } - a.foo(123) checkType { _() } - a.foo("") checkType { _() } + a.foo(123) checkType { _() } + a.foo("") checkType { _() } - a.bar(::fn) checkType { _() } - a.bar {} checkType { _() } + a.bar(::fn) checkType { _() } + a.bar {} checkType { _() } - a.bar(r) checkType { _() } + a.bar(r) checkType { _() } a.bar(null) - a.bar(null as Runnable?) checkType { _() } - a.bar(null as CharSequence?) checkType { _() } + a.bar(null as Runnable?) checkType { _() } + a.bar(null as CharSequence?) checkType { _() } - a.bar("") checkType { _() } + a.bar("") checkType { _() } a.bar(123) } diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStatic.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStatic.fir.kt index 8010a01b4a1..6f8ef36d796 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStatic.fir.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStatic.fir.kt @@ -11,26 +11,26 @@ public class A { // FILE: 1.kt fun fn() {} fun x(r: Runnable) { - A.foo(::fn) checkType { _() } - A.foo {} checkType { _() } + A.foo(::fn) checkType { _() } + A.foo {} checkType { _() } - A.foo(null) checkType { _() } - A.foo(Runnable { }) checkType { _() } - A.foo(r) checkType { _() } + A.foo(null) checkType { _() } + A.foo(Runnable { }) checkType { _() } + A.foo(r) checkType { _() } - A.foo(123) checkType { _() } - A.foo("") checkType { _() } + A.foo(123) checkType { _() } + A.foo("") checkType { _() } - A.bar(::fn) checkType { _() } - A.bar {} checkType { _() } + A.bar(::fn) checkType { _() } + A.bar {} checkType { _() } - A.bar(r) checkType { _() } + A.bar(r) checkType { _() } A.bar(null) - A.bar(null as Runnable?) checkType { _() } - A.bar(null as CharSequence?) checkType { _() } + A.bar(null as Runnable?) checkType { _() } + A.bar(null as CharSequence?) checkType { _() } - A.bar("") checkType { _() } + A.bar("") checkType { _() } A.bar(123) } diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStaticWithoutRefinedSams.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStaticWithoutRefinedSams.fir.kt index 5861cef2797..227af6c4a05 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStaticWithoutRefinedSams.fir.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStaticWithoutRefinedSams.fir.kt @@ -12,26 +12,26 @@ public class A { // FILE: 1.kt fun fn() {} fun x(r: Runnable) { - A.foo(::fn) checkType { _() } - A.foo {} checkType { _() } + A.foo(::fn) checkType { _() } + A.foo {} checkType { _() } - A.foo(null) checkType { _() } - A.foo(Runnable { }) checkType { _() } - A.foo(r) checkType { _() } + A.foo(null) checkType { _() } + A.foo(Runnable { }) checkType { _() } + A.foo(r) checkType { _() } - A.foo(123) checkType { _() } - A.foo("") checkType { _() } + A.foo(123) checkType { _() } + A.foo("") checkType { _() } - A.bar(::fn) checkType { _() } - A.bar {} checkType { _() } + A.bar(::fn) checkType { _() } + A.bar {} checkType { _() } - A.bar(r) checkType { _() } + A.bar(r) checkType { _() } A.bar(null) - A.bar(null as Runnable?) checkType { _() } - A.bar(null as CharSequence?) checkType { _() } + A.bar(null as Runnable?) checkType { _() } + A.bar(null as CharSequence?) checkType { _() } - A.bar("") checkType { _() } + A.bar("") checkType { _() } A.bar(123) } diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionWithoutRefinedSams.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionWithoutRefinedSams.fir.kt index 4f02afb50ed..6408291a5f0 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionWithoutRefinedSams.fir.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionWithoutRefinedSams.fir.kt @@ -12,26 +12,26 @@ public class A { // FILE: 1.kt fun fn() {} fun x(a: A, r: Runnable) { - a.foo(::fn) checkType { _() } - a.foo {} checkType { _() } + a.foo(::fn) checkType { _() } + a.foo {} checkType { _() } - a.foo(null) checkType { _() } - a.foo(Runnable { }) checkType { _() } - a.foo(r) checkType { _() } + a.foo(null) checkType { _() } + a.foo(Runnable { }) checkType { _() } + a.foo(r) checkType { _() } - a.foo(123) checkType { _() } - a.foo("") checkType { _() } + a.foo(123) checkType { _() } + a.foo("") checkType { _() } - a.bar(::fn) checkType { _() } - a.bar {} checkType { _() } + a.bar(::fn) checkType { _() } + a.bar {} checkType { _() } - a.bar(r) checkType { _() } + a.bar(r) checkType { _() } a.bar(null) - a.bar(null as Runnable?) checkType { _() } - a.bar(null as CharSequence?) checkType { _() } + a.bar(null as Runnable?) checkType { _() } + a.bar(null as CharSequence?) checkType { _() } - a.bar("") checkType { _() } + a.bar("") checkType { _() } a.bar(123) } diff --git a/compiler/testData/diagnostics/tests/typealias/constructorCallThroughPrivateAlias.fir.kt b/compiler/testData/diagnostics/tests/typealias/constructorCallThroughPrivateAlias.fir.kt index 777b7a75749..1475e2951eb 100644 --- a/compiler/testData/diagnostics/tests/typealias/constructorCallThroughPrivateAlias.fir.kt +++ b/compiler/testData/diagnostics/tests/typealias/constructorCallThroughPrivateAlias.fir.kt @@ -11,7 +11,7 @@ private typealias A3 = B fun A3(x: Any) = "OK" fun bar() { - A3("") checkType { _() } + A3("") checkType { _() } } // FILE: main.kt @@ -23,7 +23,7 @@ fun baz() { a.A1("") // resolved to B constructor, OK a.A2("") // resolved to B constructor, INVISIBLE_MEMBER because type alias is private, OK - a.A3("") checkType { _() } + a.A3("") checkType { _() } val x: a.A2 = B("") // A2 is unresolved because it's private in file, OK } diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorVsFunction.fir.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorVsFunction.fir.kt deleted file mode 100644 index f4b3547a87d..00000000000 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorVsFunction.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -// !CHECK_TYPE -// FILE: a.kt -class B(x: String) - -typealias A1 = B -private typealias A2 = B -private typealias A3 = B - -fun A3(x: Any) = "OK" - -fun bar() { - A3("") checkType { _() } -} diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorVsFunction.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorVsFunction.kt index bef167d4c92..12db48ae768 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorVsFunction.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorVsFunction.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE // !CHECK_TYPE // FILE: a.kt diff --git a/compiler/testData/diagnostics/tests/varargs/varargsAndOut1.fir.kt b/compiler/testData/diagnostics/tests/varargs/varargsAndOut1.fir.kt deleted file mode 100644 index 04f8ff3f045..00000000000 --- a/compiler/testData/diagnostics/tests/varargs/varargsAndOut1.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// !CHECK_TYPE - -fun test(vararg a: String) { - a checkType { _>() } - - foo(a) checkType { _>() } -} - -fun test1(vararg t: T) { - t checkType { _>() } -} - -fun foo(a: Array): Array = a \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/varargs/varargsAndOut1.kt b/compiler/testData/diagnostics/tests/varargs/varargsAndOut1.kt index 4a3277928a8..4cb9f3691ef 100644 --- a/compiler/testData/diagnostics/tests/varargs/varargsAndOut1.kt +++ b/compiler/testData/diagnostics/tests/varargs/varargsAndOut1.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE fun test(vararg a: String) { diff --git a/compiler/testData/diagnostics/testsWithStdLib/builtins/arraysAreCloneable.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/builtins/arraysAreCloneable.fir.kt deleted file mode 100644 index b6e40ce955e..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/builtins/arraysAreCloneable.fir.kt +++ /dev/null @@ -1,25 +0,0 @@ -// !CHECK_TYPE - -fun foo(x: Cloneable) = x - -fun test() { - foo(arrayOf("")) - foo(intArrayOf()) - foo(longArrayOf()) - foo(shortArrayOf()) - foo(byteArrayOf()) - foo(charArrayOf()) - foo(doubleArrayOf()) - foo(floatArrayOf()) - foo(booleanArrayOf()) - - arrayOf("").clone() checkType { _>() } - intArrayOf().clone() checkType { _() } - longArrayOf().clone() checkType { _() } - shortArrayOf().clone() checkType { _() } - byteArrayOf().clone() checkType { _() } - charArrayOf().clone() checkType { _() } - doubleArrayOf().clone() checkType { _() } - floatArrayOf().clone() checkType { _() } - booleanArrayOf().clone() checkType { _() } -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/builtins/arraysAreCloneable.kt b/compiler/testData/diagnostics/testsWithStdLib/builtins/arraysAreCloneable.kt index 8059c4900ae..67866110c4e 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/builtins/arraysAreCloneable.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/builtins/arraysAreCloneable.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE fun foo(x: Cloneable) = x diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/nonLambdaLiteralAsArgument.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/nonLambdaLiteralAsArgument.fir.kt index 8744ec7d62e..ea05aa00cde 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/nonLambdaLiteralAsArgument.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/nonLambdaLiteralAsArgument.fir.kt @@ -10,6 +10,6 @@ fun passLambdaValue(l: ContractBuilder.() -> Unit) { fun passAnonymousFunction(x: Boolean) { contract(fun ContractBuilder.() { - returns() implies x + returns() implies x }) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/kt3458.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/kt3458.fir.kt deleted file mode 100644 index 8fc7524f41e..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/kt3458.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// !CHECK_TYPE - -import java.io.File - -fun test() { - val dir = File("dir") - val files = dir.listFiles()?.toList() ?: listOf() // error - files checkType { _>() } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/kt3458.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/kt3458.kt index 03cf7f8b523..79482e64012 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/kt3458.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/kt3458.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE import java.io.File diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/kt4975.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/kt4975.fir.kt deleted file mode 100644 index 7a9267a731e..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/kt4975.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// !CHECK_TYPE - -fun bar(f: () -> T) : T = f() - -fun test(map: MutableMap) { - val r = bar { - map[1] = 2 - } - r checkType { _() } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/kt4975.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/kt4975.kt index 921a68f7936..c4fc78afd46 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/kt4975.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/kt4975.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE fun bar(f: () -> T) : T = f() diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/hidesMembers.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/hidesMembers.fir.kt index 17ace407e31..2a3392183b7 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/hidesMembers.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/hidesMembers.fir.kt @@ -36,9 +36,9 @@ fun A.forEach() = "" fun A.forEach(s: String) {} fun test(a: A) { - a.forEach() checkType { _() } + a.forEach() checkType { _() } - a.forEach(1) checkType { _() } + a.forEach(1) checkType { _() } a.forEach("") diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/hidesMembers2.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/hidesMembers2.fir.kt index 09624f556de..dc9fba5def3 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/hidesMembers2.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/hidesMembers2.fir.kt @@ -17,7 +17,7 @@ class B { fun A.forEach() = this@B fun test(a: A) { - a.forEach() checkType { _() } // todo + a.forEach() checkType { _() } // todo with(a) { forEach() checkType { _() } // todo @@ -34,7 +34,7 @@ fun test2(a: A) { @kotlin.internal.HidesMembers fun A.forEach(i: Int) = "" - a.forEach() checkType { _() } + a.forEach() checkType { _() } a.forEach(1) with(a) { diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/samAgainstFunctionalType.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/samAgainstFunctionalType.fir.kt index c4068183517..ba53fff0680 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/samAgainstFunctionalType.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/samAgainstFunctionalType.fir.kt @@ -25,6 +25,6 @@ public class StaticOverrides { fun test() { StaticOverrides.A.foo {} checkType { _() } - StaticOverrides.B.foo {} checkType { _() } - StaticOverrides.C.foo {} checkType { _() } + StaticOverrides.B.foo {} checkType { _() } + StaticOverrides.C.foo {} checkType { _() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/targetedBuiltIns/unsupportedFeature.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/targetedBuiltIns/unsupportedFeature.fir.kt index 3f1d73aa51d..ac552db0129 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/targetedBuiltIns/unsupportedFeature.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/targetedBuiltIns/unsupportedFeature.fir.kt @@ -44,7 +44,7 @@ fun foo(x: List, y: Throwable, z: A3) { x.stream() java.util.ArrayList().stream() - y.fillInStackTrace() checkType { _() } + y.fillInStackTrace() checkType { _() } HashMap().getOrDefault(Any(), null) diff --git a/compiler/testData/diagnostics/testsWithStdLib/varargs/kt3213.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/varargs/kt3213.fir.kt deleted file mode 100644 index 33f8c6d3900..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/varargs/kt3213.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -// !CHECK_TYPE - -fun test(a: Array) { - val b = a.toList() - - b checkType { _>() } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/varargs/kt3213.kt b/compiler/testData/diagnostics/testsWithStdLib/varargs/kt3213.kt index 2ba6c1b72f4..e648c102456 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/varargs/kt3213.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/varargs/kt3213.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE fun test(a: Array) {