diff --git a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/classes/Deprecated.txt b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/classes/Deprecated.txt index bf491419dfe..af93ef98725 100644 --- a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/classes/Deprecated.txt +++ b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/classes/Deprecated.txt @@ -5,7 +5,7 @@ } @R|kotlin/Deprecated|(message = String(Inner)) public final inner class Inner : R|kotlin/Any| { - public constructor(): R|test/Class.Inner| + public test/Class.constructor(): R|test/Class.Inner| } diff --git a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/classes/EnumArgument.txt b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/classes/EnumArgument.txt index 1a98d5ce3b4..856dccd8541 100644 --- a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/classes/EnumArgument.txt +++ b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/classes/EnumArgument.txt @@ -13,7 +13,7 @@ public final annotation class Anno : R|kotlin/Annotation| { } @R|test/Anno|(t = R|java/lang/annotation/ElementType.PARAMETER|()) public final inner class Inner : R|kotlin/Any| { - public constructor(): R|test/Class.Inner| + public test/Class.constructor(): R|test/Class.Inner| } diff --git a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/classes/NestedClass.txt b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/classes/NestedClass.txt index 38caf65f192..2f8c13c8e7c 100644 --- a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/classes/NestedClass.txt +++ b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/classes/NestedClass.txt @@ -5,7 +5,7 @@ public final annotation class Anno : R|kotlin/Annotation| { public final class Class : R|kotlin/Any| { @R|test/Anno|() public final inner class Inner : R|kotlin/Any| { - public constructor(): R|test/Class.Inner| + public test/Class.constructor(): R|test/Class.Inner| } diff --git a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/parameters/InnerClassConstructor.txt b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/parameters/InnerClassConstructor.txt index cf2600196a1..65a64b36267 100644 --- a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/parameters/InnerClassConstructor.txt +++ b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/parameters/InnerClassConstructor.txt @@ -11,7 +11,7 @@ public final class Outer : R|kotlin/Any| { public final val y: R|kotlin/String| public get(): R|kotlin/String| - public constructor(@R|test/A|(s = String(inner)) y: R|kotlin/String|): R|test/Outer.Inner| + public test/Outer.constructor(@R|test/A|(s = String(inner)) y: R|kotlin/String|): R|test/Outer.Inner| } diff --git a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/types/ClassLiteralArgument.txt b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/types/ClassLiteralArgument.txt index 9b5c7238180..bc0536b54e2 100644 --- a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/types/ClassLiteralArgument.txt +++ b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/types/ClassLiteralArgument.txt @@ -26,7 +26,7 @@ public final class Generic : R|kotlin/Any| { public final class InnerGeneric : R|kotlin/Any| { public final inner class Inner : R|kotlin/Any| { - public constructor(): R|test/InnerGeneric.Inner| + public test/InnerGeneric.constructor(): R|test/InnerGeneric.Inner| } diff --git a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/class/ClassInnerClass.txt b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/class/ClassInnerClass.txt index 664f90f2995..86233c6ee20 100644 --- a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/class/ClassInnerClass.txt +++ b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/class/ClassInnerClass.txt @@ -1,6 +1,6 @@ public final class Outer : R|kotlin/Any| { public final inner class Inner : R|kotlin/Any| { - public constructor(): R|test/Outer.Inner| + public test/Outer.constructor(): R|test/Outer.Inner| } diff --git a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/class/InnerClassExtendInnerClass.txt b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/class/InnerClassExtendInnerClass.txt index afb13f26477..ef9de71991e 100644 --- a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/class/InnerClassExtendInnerClass.txt +++ b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/class/InnerClassExtendInnerClass.txt @@ -1,11 +1,11 @@ public final class Outer : R|kotlin/Any| { public open inner class Inner1 : R|kotlin/Any| { - public constructor(): R|test/Outer.Inner1| + public test/Outer.constructor(): R|test/Outer.Inner1| } public final inner class Inner2 : R|test/Outer.Inner1| { - public constructor(): R|test/Outer.Inner2| + public test/Outer.constructor(): R|test/Outer.Inner2| } diff --git a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/class/InnerGenericClass.txt b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/class/InnerGenericClass.txt index cc82110f2d6..1d5ad4ad359 100644 --- a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/class/InnerGenericClass.txt +++ b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/class/InnerGenericClass.txt @@ -1,6 +1,6 @@ public final class Outer : R|kotlin/Any| { public final inner class Inner : R|kotlin/Any| { - public constructor(): R|test/Outer.Inner| + public test/Outer.constructor(): R|test/Outer.Inner| } diff --git a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/class/InnerTypes.txt b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/class/InnerTypes.txt index 49cb80ab03e..9bdf3f53308 100644 --- a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/class/InnerTypes.txt +++ b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/class/InnerTypes.txt @@ -3,16 +3,16 @@ public final class Outer : R|kotlin/Any| { public final inner class Inner3 : R|kotlin/Any| { public final fun foo(x: R|test/Outer.Inner|, y: R|test/Outer.Inner|, z: R|test/Outer.Inner.Inner3|, w: R|test/Outer.Inner.Inner3<*, G, H, E, F>|): R|kotlin/Unit| - public constructor(): R|test/Outer.Inner.Inner3| + public test/Outer.Inner.constructor(): R|test/Outer.Inner.Inner3| } - public constructor(): R|test/Outer.Inner| + public test/Outer.constructor(): R|test/Outer.Inner| } public final inner class Inner2 : R|kotlin/Any| { - public constructor(): R|test/Outer.Inner2| + public test/Outer.constructor(): R|test/Outer.Inner2| } diff --git a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/classObject/InnerClassInClassObject.txt b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/classObject/InnerClassInClassObject.txt index d0f1bc501c4..8fdf9deca0c 100644 --- a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/classObject/InnerClassInClassObject.txt +++ b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/classObject/InnerClassInClassObject.txt @@ -9,12 +9,12 @@ public final class TestFirst : R|kotlin/Any| { } public final inner class InnerClass : R|kotlin/Any| { - public constructor(): R|test/TestFirst.InnerClass| + public test/TestFirst.constructor(): R|test/TestFirst.InnerClass| } public final inner class NotInnerClass : R|kotlin/Any| { - public constructor(): R|test/TestFirst.NotInnerClass| + public test/TestFirst.constructor(): R|test/TestFirst.NotInnerClass| } diff --git a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/enum/EnumWithInnerClasses.txt b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/enum/EnumWithInnerClasses.txt index 2c511af6093..6993f170c33 100644 --- a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/enum/EnumWithInnerClasses.txt +++ b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/enum/EnumWithInnerClasses.txt @@ -1,6 +1,6 @@ public final enum class Enum : R|kotlin/Enum| { public final inner class Inner : R|kotlin/Any| { - public constructor(): R|test/Enum.Inner| + public test/Enum.constructor(): R|test/Enum.Inner| } diff --git a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/fromLoadJava/InnerClass.txt b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/fromLoadJava/InnerClass.txt index 4bab7f26a54..371283c640a 100644 --- a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/fromLoadJava/InnerClass.txt +++ b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/fromLoadJava/InnerClass.txt @@ -1,6 +1,6 @@ public open class InnerClass : R|kotlin/Any| { public open inner class Inner : R|kotlin/Any| { - public constructor(): R|test/InnerClass.Inner| + public test/InnerClass.constructor(): R|test/InnerClass.Inner| } diff --git a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/memberOrder/InnerClasses.txt b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/memberOrder/InnerClasses.txt index 8b9de778496..d51626eeb1f 100644 --- a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/memberOrder/InnerClasses.txt +++ b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/memberOrder/InnerClasses.txt @@ -5,7 +5,7 @@ public final class O : R|kotlin/Any| { } public final inner class A2 : R|kotlin/Any| { - public constructor(): R|test/O.A2| + public test/O.constructor(): R|test/O.A2| } @@ -15,7 +15,7 @@ public final class O : R|kotlin/Any| { } public final inner class B2 : R|kotlin/Any| { - public constructor(): R|test/O.B2| + public test/O.constructor(): R|test/O.B2| } diff --git a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/nested/DeepInnerGeneric.txt b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/nested/DeepInnerGeneric.txt index 8f428927129..5f64ca24cf9 100644 --- a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/nested/DeepInnerGeneric.txt +++ b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/nested/DeepInnerGeneric.txt @@ -6,15 +6,15 @@ public final class A : R|kotlin/Any| { public final fun foo(p1: R|P1|, p2: R|P2|, p3: R|P3|, p4: R|P4|): R|kotlin/Nothing| - public constructor(): R|test/A.B.C.D| + public test/A.B.C.constructor(): R|test/A.B.C.D| } - public constructor(): R|test/A.B.C| + public test/A.B.constructor(): R|test/A.B.C| } - public constructor(): R|test/A.B| + public test/A.constructor(): R|test/A.B| } diff --git a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/nested/InnerClassReferencesOuterTP.txt b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/nested/InnerClassReferencesOuterTP.txt index ee92ea56d06..cf5f517b3ed 100644 --- a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/nested/InnerClassReferencesOuterTP.txt +++ b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/nested/InnerClassReferencesOuterTP.txt @@ -1,6 +1,6 @@ public final class InnerClassReferencesOuterTP

: R|kotlin/Any| { public final inner class Inner : R|kotlin/Any| { - public constructor(): R|test/InnerClassReferencesOuterTP.Inner| + public test/InnerClassReferencesOuterTP

.constructor(): R|test/InnerClassReferencesOuterTP.Inner| } diff --git a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/nested/MembersReferenceOuterTP.txt b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/nested/MembersReferenceOuterTP.txt index 314e3d967f9..83271172a6b 100644 --- a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/nested/MembersReferenceOuterTP.txt +++ b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/nested/MembersReferenceOuterTP.txt @@ -10,7 +10,7 @@ public final class MembersReferenceOuterTP

: R|kotlin/Any| { public final val R|Q|.w: R|Q| public get(): R|Q| - public constructor(): R|test/MembersReferenceOuterTP.Inner

| + public test/MembersReferenceOuterTP

.constructor(): R|test/MembersReferenceOuterTP.Inner

| } diff --git a/compiler/fir/fir-deserialization/src/org/jetbrains/kotlin/fir/deserialization/FirMemberDeserializer.kt b/compiler/fir/fir-deserialization/src/org/jetbrains/kotlin/fir/deserialization/FirMemberDeserializer.kt index cd2e42e4da7..d33f8cfd312 100644 --- a/compiler/fir/fir-deserialization/src/org/jetbrains/kotlin/fir/deserialization/FirMemberDeserializer.kt +++ b/compiler/fir/fir-deserialization/src/org/jetbrains/kotlin/fir/deserialization/FirMemberDeserializer.kt @@ -49,7 +49,7 @@ class FirDeserializationContext( val constDeserializer: FirConstDeserializer, val containerSource: DeserializedContainerSource?, val outerClassSymbol: FirRegularClassSymbol?, - outerTypeParameters: List + val outerTypeParameters: List ) { val session: FirSession = moduleData.session @@ -527,6 +527,7 @@ class FirMemberDeserializer(private val c: FirDeserializationContext) { origin = FirDeclarationOrigin.Library returnTypeRef = delegatedSelfType val visibility = ProtoEnumFlags.visibility(Flags.VISIBILITY.get(flags)) + val isInner = classBuilder.status.isInner status = FirResolvedDeclarationStatusImpl( visibility, Modality.FINAL, @@ -535,9 +536,14 @@ class FirMemberDeserializer(private val c: FirDeserializationContext) { isExpect = Flags.IS_EXPECT_FUNCTION.get(flags) isActual = false isOverride = false - isInner = classBuilder.status.isInner + this.isInner = isInner } this.symbol = symbol + dispatchReceiverType = + if (!isInner) null + else with(c) { + ClassId(packageFqName, relativeClassName.parent(), false).defaultType(outerTypeParameters) + } resolvePhase = FirResolvePhase.ANALYZED_DEPENDENCIES this.typeParameters += typeParameters.filterIsInstance()