From caa850e4709a2bbfe2e787685d7a135cbfb9b21d Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Mon, 15 Jan 2024 22:35:23 +0100 Subject: [PATCH] FIR: render resolved qualifier type arguments in dumps --- ...romIncorrectAccessorsPropagationScript.lazyResolve.txt | 2 +- ...plicitTypeFromIncorrectAccessorsScript.lazyResolve.txt | 2 +- .../annotationArgumentKClassLiteralTypeError.fir.txt | 2 +- .../resolve/diagnostics/typeArgumentsNotAllowed.fir.txt | 2 +- .../incorrectReferenceOnInnerClassMember.fir.txt | 4 ++-- .../mutablePropertyGenericButNotCapturedType.fir.txt | 8 ++++---- .../references/mutablePropertyWithCapturedType.fir.txt | 2 +- .../resolve/references/referenceToExtension.fir.txt | 8 ++++---- ...referenceToSyntheticJavaPropertyWithProjection.fir.txt | 4 ++-- .../testData/resolveWithStdlib/reflectionClass.fir.txt | 2 +- .../src/org/jetbrains/kotlin/fir/renderer/FirRenderer.kt | 1 + .../incompleteCode/incompleteConstructorCall.fir.txt | 4 ++-- .../callableReferenceUnboundCase.fir.txt | 2 +- 13 files changed, 22 insertions(+), 21 deletions(-) diff --git a/analysis/low-level-api-fir/testData/lazyResolveTypeAnnotations/property/implicitTypeFromIncorrectAccessorsPropagationScript.lazyResolve.txt b/analysis/low-level-api-fir/testData/lazyResolveTypeAnnotations/property/implicitTypeFromIncorrectAccessorsPropagationScript.lazyResolve.txt index ac126bb0050..da89d06d6dc 100644 --- a/analysis/low-level-api-fir/testData/lazyResolveTypeAnnotations/property/implicitTypeFromIncorrectAccessorsPropagationScript.lazyResolve.txt +++ b/analysis/low-level-api-fir/testData/lazyResolveTypeAnnotations/property/implicitTypeFromIncorrectAccessorsPropagationScript.lazyResolve.txt @@ -437,7 +437,7 @@ FILE: [ResolvedTo(BODY_RESOLVE)] implicitTypeFromIncorrectAccessorsPropagationSc } [ResolvedTo(BODY_RESOLVE)] init { - @R|low/Anno|[Types](position = (String(setter parameter type ), R|low/prop|)) Q|kotlin/collections/List| + @R|low/Anno|[Types](position = (String(setter parameter type ), R|low/prop|)) Q|kotlin/collections/List|(String(setter nested parameter type ), R|low/prop|)) kotlin/collections/Collection<@R|low/Anno|(position = (String(setter nested nested parameter type ), R|low/prop|)) kotlin/String>|> } public final [ResolvedTo(BODY_RESOLVE)] val $$result: = # diff --git a/analysis/low-level-api-fir/testData/lazyResolveTypeAnnotations/property/implicitTypeFromIncorrectAccessorsScript.lazyResolve.txt b/analysis/low-level-api-fir/testData/lazyResolveTypeAnnotations/property/implicitTypeFromIncorrectAccessorsScript.lazyResolve.txt index 9650b0ac7f6..dd1151f5591 100644 --- a/analysis/low-level-api-fir/testData/lazyResolveTypeAnnotations/property/implicitTypeFromIncorrectAccessorsScript.lazyResolve.txt +++ b/analysis/low-level-api-fir/testData/lazyResolveTypeAnnotations/property/implicitTypeFromIncorrectAccessorsScript.lazyResolve.txt @@ -398,7 +398,7 @@ FILE: [ResolvedTo(BODY_RESOLVE)] implicitTypeFromIncorrectAccessorsScript.kts } [ResolvedTo(BODY_RESOLVE)] init { - @R|low/Anno|[Types](position = (String(setter parameter type ), R|low/prop|)) Q|kotlin/collections/List| + @R|low/Anno|[Types](position = (String(setter parameter type ), R|low/prop|)) Q|kotlin/collections/List|(String(setter nested parameter type ), R|low/prop|)) kotlin/collections/Collection<@R|low/Anno|(position = (String(setter nested nested parameter type ), R|low/prop|)) kotlin/String>|> } public final [ResolvedTo(BODY_RESOLVE)] val $$result: = # diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/annotationArgumentKClassLiteralTypeError.fir.txt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/annotationArgumentKClassLiteralTypeError.fir.txt index c25aabb0e9e..2a00e49e66a 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/annotationArgumentKClassLiteralTypeError.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/annotationArgumentKClassLiteralTypeError.fir.txt @@ -10,7 +10,7 @@ FILE: annotationArgumentKClassLiteralTypeError.kt } public final val R|T|.test: R|kotlin/Any| public inline get(): R|kotlin/Any| { - ^ @R|Ann|(a = ((R|T|), (Q|kotlin/Array|))) object : R|kotlin/Any| { + ^ @R|Ann|(a = ((R|T|), (Q|kotlin/Array|>>|>))) object : R|kotlin/Any| { private constructor(): R|| { super() } diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/typeArgumentsNotAllowed.fir.txt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/typeArgumentsNotAllowed.fir.txt index 6320d0b4adc..c758ba80337 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/typeArgumentsNotAllowed.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/typeArgumentsNotAllowed.fir.txt @@ -24,7 +24,7 @@ FILE: typeArgumentsNotAllowed.kt } } - public final val a: = Q|rest|.# + public final val a: = Q|rest|.# public get(): public final val b: = Q|rest/Best|.# public get(): diff --git a/compiler/fir/analysis-tests/testData/resolve/references/incorrectReferenceOnInnerClassMember.fir.txt b/compiler/fir/analysis-tests/testData/resolve/references/incorrectReferenceOnInnerClassMember.fir.txt index 8ca5c9d73d2..add6da75722 100644 --- a/compiler/fir/analysis-tests/testData/resolve/references/incorrectReferenceOnInnerClassMember.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/references/incorrectReferenceOnInnerClassMember.fir.txt @@ -18,6 +18,6 @@ FILE: incorrectReferenceOnInnerClassMember.kt } public final fun test(): R|kotlin/Unit| { - Q|foo/Outer|.#(Int(42)) - Q|foo/Outer|.#(Int(42))::# + Q|foo/Outer|.#(Int(42)) + Q|foo/Outer|.#(Int(42))::# } diff --git a/compiler/fir/analysis-tests/testData/resolve/references/mutablePropertyGenericButNotCapturedType.fir.txt b/compiler/fir/analysis-tests/testData/resolve/references/mutablePropertyGenericButNotCapturedType.fir.txt index 17c9d6e2b61..cc580708ca7 100644 --- a/compiler/fir/analysis-tests/testData/resolve/references/mutablePropertyGenericButNotCapturedType.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/references/mutablePropertyGenericButNotCapturedType.fir.txt @@ -15,20 +15,20 @@ FILE: mutablePropertyGenericButNotCapturedType.kt public set(value: R|Generic|): R|kotlin/Unit| public final fun testWithinClass(): R|kotlin/Unit| { - lval mutableProperty: R|kotlin/reflect/KMutableProperty1, Generic>| = Q|Klass|::R|/Klass.mutableProperty| + lval mutableProperty: R|kotlin/reflect/KMutableProperty1, Generic>| = Q|Klass|::R|/Klass.mutableProperty| R|/mutableProperty|.R|SubstitutionOverride|(this@R|/Klass|, R|/Generic.Generic|()) } } public final fun testConcreteType(): R|kotlin/Unit| { - lval mutableProperty: R|kotlin/reflect/KMutableProperty1, Generic>| = Q|Klass|::R|SubstitutionOverride|>| + lval mutableProperty: R|kotlin/reflect/KMutableProperty1, Generic>| = Q|Klass|::R|SubstitutionOverride|>| R|/mutableProperty|.R|SubstitutionOverride|(R|/Klass.Klass|(), R|/Generic.Generic|()) } public final fun testGenericType(): R|kotlin/Unit| { - lval mutableProperty: R|kotlin/reflect/KMutableProperty1, Generic>| = Q|Klass|::R|SubstitutionOverride|>| + lval mutableProperty: R|kotlin/reflect/KMutableProperty1, Generic>| = Q|Klass|::R|SubstitutionOverride|>| R|/mutableProperty|.R|SubstitutionOverride|(R|/Klass.Klass|(), R|/Generic.Generic|()) } public final fun testGenericTypeWithBounds(): R|kotlin/Unit| { - lval mutableProperty: R|kotlin/reflect/KMutableProperty1, Generic>| = Q|Klass|::R|SubstitutionOverride|>| + lval mutableProperty: R|kotlin/reflect/KMutableProperty1, Generic>| = Q|Klass|::R|SubstitutionOverride|>| R|/mutableProperty|.R|SubstitutionOverride|(R|/Klass.Klass|(), R|/Generic.Generic|()) } diff --git a/compiler/fir/analysis-tests/testData/resolve/references/mutablePropertyWithCapturedType.fir.txt b/compiler/fir/analysis-tests/testData/resolve/references/mutablePropertyWithCapturedType.fir.txt index c98e48c54a1..d48b9e3c016 100644 --- a/compiler/fir/analysis-tests/testData/resolve/references/mutablePropertyWithCapturedType.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/references/mutablePropertyWithCapturedType.fir.txt @@ -16,6 +16,6 @@ FILE: mutablePropertyWithCapturedType.kt } public final fun test(): R|kotlin/Unit| { - lval mutableProperty: R|kotlin/reflect/KMutableProperty1, Generic>| = Q|Klass|::R|SubstitutionOverride|>| + lval mutableProperty: R|kotlin/reflect/KMutableProperty1, Generic>| = Q|Klass|<*>::R|SubstitutionOverride|>| R|/mutableProperty|.R|SubstitutionOverride|(R|/Klass.Klass|(), R|/Generic.Generic|()) } diff --git a/compiler/fir/analysis-tests/testData/resolve/references/referenceToExtension.fir.txt b/compiler/fir/analysis-tests/testData/resolve/references/referenceToExtension.fir.txt index ec0b5a23300..94024affbf3 100644 --- a/compiler/fir/analysis-tests/testData/resolve/references/referenceToExtension.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/references/referenceToExtension.fir.txt @@ -35,13 +35,13 @@ FILE: referenceToExtension.kt } public final fun test_1(): R|kotlin/Unit| { - lval memberValRef: R|kotlin/reflect/KProperty1, GenericTest.A>| = Q|GenericTest.B|::R|SubstitutionOverride|>| - lval memberFunRef: R|kotlin/reflect/KFunction1, GenericTest.A>| = Q|GenericTest.B|::R|SubstitutionOverride|>| + lval memberValRef: R|kotlin/reflect/KProperty1, GenericTest.A>| = Q|GenericTest.B|<*>::R|SubstitutionOverride|>| + lval memberFunRef: R|kotlin/reflect/KFunction1, GenericTest.A>| = Q|GenericTest.B|<*>::R|SubstitutionOverride|>| } public final fun test_2(): R|kotlin/Unit| { - lval extensionValRef: R|kotlin/reflect/KProperty1, GenericTest.A>| = Q|GenericTest.B|::R|/GenericTest.extensionVal| - lval extensionFunRef: R|@ExtensionFunctionType kotlin/reflect/KFunction1, GenericTest.A>| = Q|GenericTest.B|::R|/GenericTest.extensionFun| + lval extensionValRef: R|kotlin/reflect/KProperty1, GenericTest.A>| = Q|GenericTest.B|<*>::R|/GenericTest.extensionVal| + lval extensionFunRef: R|@ExtensionFunctionType kotlin/reflect/KFunction1, GenericTest.A>| = Q|GenericTest.B|<*>::R|/GenericTest.extensionFun| } } diff --git a/compiler/fir/analysis-tests/testData/resolve/references/referenceToSyntheticJavaPropertyWithProjection.fir.txt b/compiler/fir/analysis-tests/testData/resolve/references/referenceToSyntheticJavaPropertyWithProjection.fir.txt index e9d259ed3e8..291c408b53a 100644 --- a/compiler/fir/analysis-tests/testData/resolve/references/referenceToSyntheticJavaPropertyWithProjection.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/references/referenceToSyntheticJavaPropertyWithProjection.fir.txt @@ -9,6 +9,6 @@ FILE: main.kt } public final fun test(): R|kotlin/Unit| { - Q|JavaInv|::R|/JavaInv.stringVal| - Q|KotlinInv|::R|SubstitutionOverride| + Q|JavaInv|::R|/JavaInv.stringVal| + Q|KotlinInv|::R|SubstitutionOverride| } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/reflectionClass.fir.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/reflectionClass.fir.txt index 57050f2b651..92834dd4960 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/reflectionClass.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/reflectionClass.fir.txt @@ -5,5 +5,5 @@ FILE: reflectionClass.kt public get(): R|kotlin/reflect/KClass| public final fun foo(): R|kotlin/Unit| { lval stringClass: R|java/lang/Class| = (Q|kotlin/String|).R|kotlin/jvm/java| - lval arrayStringClass: R|java/lang/Class>| = (Q|kotlin/Array|).R|kotlin/jvm/java||> + lval arrayStringClass: R|java/lang/Class>| = (Q|kotlin/Array|).R|kotlin/jvm/java||> } diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/renderer/FirRenderer.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/renderer/FirRenderer.kt index 2674f95c3a0..052889af8a5 100644 --- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/renderer/FirRenderer.kt +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/renderer/FirRenderer.kt @@ -1154,6 +1154,7 @@ class FirRenderer( override fun visitResolvedQualifier(resolvedQualifier: FirResolvedQualifier) { resolvedQualifierRenderer.render(resolvedQualifier) + resolvedQualifier.typeArguments.renderTypeArguments() } override fun visitBinaryLogicExpression(binaryLogicExpression: FirBinaryLogicExpression) { diff --git a/compiler/testData/diagnostics/tests/incompleteCode/incompleteConstructorCall.fir.txt b/compiler/testData/diagnostics/tests/incompleteCode/incompleteConstructorCall.fir.txt index 82d754b05fd..dcd13b0cf77 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/incompleteConstructorCall.fir.txt +++ b/compiler/testData/diagnostics/tests/incompleteCode/incompleteConstructorCall.fir.txt @@ -47,9 +47,9 @@ FILE: incompleteConstructorCall.fir.kt } } - public final val test: R|Outer.Companion| = Q|Outer| + public final val test: R|Outer.Companion| = Q|Outer| public get(): R|Outer.Companion| - public final val test2: R|Outer.Nested.Companion| = Q|Outer.Nested| + public final val test2: R|Outer.Nested.Companion| = Q|Outer.Nested| public get(): R|Outer.Nested.Companion| public final val test3: R|Outer.Inner.Companion| = R|kotlin/Double| public get(): R|Outer.Inner.Companion| diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/ambiguousTypeReferences/callableReferenceUnboundCase.fir.txt b/compiler/testData/diagnostics/testsWithStdLib/resolve/ambiguousTypeReferences/callableReferenceUnboundCase.fir.txt index 42894825997..81bcf5b5627 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/ambiguousTypeReferences/callableReferenceUnboundCase.fir.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/ambiguousTypeReferences/callableReferenceUnboundCase.fir.txt @@ -1,4 +1,4 @@ FILE: test.kt public final fun test(): R|kotlin/reflect/KProperty1, kotlin/Int>| { - ^test Q|kotlin/collections/HashMap|::R|SubstitutionOverride| + ^test Q|kotlin/collections/HashMap|::R|SubstitutionOverride| }