diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java index de7a434423a..4ce35844a24 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java @@ -45880,6 +45880,12 @@ public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBo runTest("compiler/testData/codegen/box/reflection/jvmKTypeCaching.kt"); } + @Test + @TestMetadata("kt63988.kt") + public void testKt63988() throws Exception { + runTest("compiler/testData/codegen/box/reflection/kt63988.kt"); + } + @Nested @TestMetadata("compiler/testData/codegen/box/reflection/annotations") @TestDataPath("$PROJECT_ROOT") @@ -47860,6 +47866,12 @@ public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBo public void testLocalClassesAndAnonymousObjects() throws Exception { runTest("compiler/testData/codegen/box/reflection/localClasses/localClassesAndAnonymousObjects.kt"); } + + @Test + @TestMetadata("localNestedClasses.kt") + public void testLocalNestedClasses() throws Exception { + runTest("compiler/testData/codegen/box/reflection/localClasses/localNestedClasses.kt"); + } } @Nested diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java index 871b318111d..5371d5a1646 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java @@ -45880,6 +45880,12 @@ public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFi runTest("compiler/testData/codegen/box/reflection/jvmKTypeCaching.kt"); } + @Test + @TestMetadata("kt63988.kt") + public void testKt63988() throws Exception { + runTest("compiler/testData/codegen/box/reflection/kt63988.kt"); + } + @Nested @TestMetadata("compiler/testData/codegen/box/reflection/annotations") @TestDataPath("$PROJECT_ROOT") @@ -47860,6 +47866,12 @@ public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFi public void testLocalClassesAndAnonymousObjects() throws Exception { runTest("compiler/testData/codegen/box/reflection/localClasses/localClassesAndAnonymousObjects.kt"); } + + @Test + @TestMetadata("localNestedClasses.kt") + public void testLocalNestedClasses() throws Exception { + runTest("compiler/testData/codegen/box/reflection/localClasses/localNestedClasses.kt"); + } } @Nested diff --git a/compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirJvmElementAwareStringTable.kt b/compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirJvmElementAwareStringTable.kt index f1946a53162..9bb708f2879 100644 --- a/compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirJvmElementAwareStringTable.kt +++ b/compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirJvmElementAwareStringTable.kt @@ -6,31 +6,52 @@ package org.jetbrains.kotlin.fir.backend.jvm import org.jetbrains.kotlin.backend.jvm.mapping.IrTypeMapper -import org.jetbrains.kotlin.backend.jvm.mapping.mapClass import org.jetbrains.kotlin.fir.backend.Fir2IrComponents import org.jetbrains.kotlin.fir.declarations.FirClass import org.jetbrains.kotlin.fir.serialization.FirElementAwareStringTable +import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer import org.jetbrains.kotlin.ir.declarations.IrClass import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmNameResolver import org.jetbrains.kotlin.metadata.jvm.serialization.JvmStringTable import org.jetbrains.kotlin.name.ClassId import org.jetbrains.kotlin.name.FqName +import org.jetbrains.kotlin.name.Name class FirJvmElementAwareStringTable( private val typeMapper: IrTypeMapper, private val components: Fir2IrComponents, + private val localPoppedUpClasses: List, nameResolver: JvmNameResolver? = null ) : JvmStringTable(nameResolver), FirElementAwareStringTable { override fun getLocalClassIdReplacement(firClass: FirClass): ClassId = components.classifierStorage.getCachedIrClass(firClass)?.getLocalClassIdReplacement() ?: throw AssertionError("not a local class: ${firClass.symbol.classId}") - private fun IrClass.getLocalClassIdReplacement(): ClassId = - when (val parent = parent) { - is IrClass -> parent.getLocalClassIdReplacement().createNestedClassId(name) - else -> { - val fqName = FqName(typeMapper.mapClass(this).internalName.replace('/', '.')) - ClassId(fqName.parent(), FqName.topLevel(fqName.shortName()), isLocal = true) + private fun IrClass.getLocalClassIdReplacement(): ClassId { + // This convoluted implementation aims to reproduce K1 behaviour (see JvmCodegenStringTable::getLocalClassIdReplacement). + // K1 uses both '.' and '$' to separate nested class names when serializing metadata. + // That does not make much sense and looks like an artifact of implementation arising from K1 descriptors structure. + // But we still need to preserve it to establish compatibility with K2-produced metadata. + + val thisClassName = typeMapper.classInternalName(this).replace('/', '.') + if (attributeOwnerId in localPoppedUpClasses) { + // For those classes, whose original parent has been changed on the lowering stage. + // In K1, the `containingDeclaration` of such class descriptor would be the original declaration: constructor or property. + // Thus, this case corresponds to the `else` branch of JvmCodegenStringTable::getLocalClassIdReplacement. + val thisClassFqName = FqName(thisClassName) + return ClassId(thisClassFqName.parent(), FqName.topLevel(thisClassFqName.shortName()), isLocal = true) + } else { + // Otherwise, find topmost class parent. Its name will have '$' as delimiter + val topmostClassParent = generateSequence(this) { it.parent as? IrClass }.last() + val topmostClassParentName = typeMapper.classInternalName(topmostClassParent).replace('/', '.') + val prefixFqName = FqName(topmostClassParentName) + var classId = ClassId(prefixFqName.parent(), FqName.topLevel(prefixFqName.shortName()), isLocal = true) + if (thisClassName.length == topmostClassParentName.length) return classId + // The remaining part uses '.' + thisClassName.substring(topmostClassParentName.length + 1).split('$').forEach { + classId = classId.createNestedClassId(Name.identifier(it)) } + return classId } + } } diff --git a/compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirJvmSerializerExtension.kt b/compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirJvmSerializerExtension.kt index 4459cb09c0c..ae455f3c36a 100644 --- a/compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirJvmSerializerExtension.kt +++ b/compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirJvmSerializerExtension.kt @@ -33,6 +33,7 @@ import org.jetbrains.kotlin.fir.serialization.FirElementSerializer import org.jetbrains.kotlin.fir.serialization.FirSerializerExtension import org.jetbrains.kotlin.fir.serialization.constant.ConstValueProvider import org.jetbrains.kotlin.fir.types.* +import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer import org.jetbrains.kotlin.ir.declarations.MetadataSource import org.jetbrains.kotlin.load.kotlin.NON_EXISTENT_CLASS_NAME import org.jetbrains.kotlin.metadata.ProtoBuf @@ -77,14 +78,27 @@ class FirJvmSerializerExtension( state: GenerationState, metadata: MetadataSource?, localDelegatedProperties: List, + localPoppedUpClasses: List, approximator: AbstractTypeApproximator, typeMapper: IrTypeMapper, components: Fir2IrComponents ) : this( - session, bindings, metadata, localDelegatedProperties, approximator, components.scopeSession, - state.globalSerializationBindings, state.config.useTypeTableInSerializer, state.moduleName, state.classBuilderMode, - state.config.isParamAssertionsDisabled, state.config.unifiedNullChecks, state.config.metadataVersion, state.jvmDefaultMode, - FirJvmElementAwareStringTable(typeMapper, components), ConstValueProviderImpl(components), + session, + bindings, + metadata, + localDelegatedProperties, + approximator, + components.scopeSession, + state.globalSerializationBindings, + state.config.useTypeTableInSerializer, + state.moduleName, + state.classBuilderMode, + state.config.isParamAssertionsDisabled, + state.config.unifiedNullChecks, + state.config.metadataVersion, + state.jvmDefaultMode, + FirJvmElementAwareStringTable(typeMapper, components, localPoppedUpClasses), + ConstValueProviderImpl(components), components.annotationsFromPluginRegistrar.createAdditionalMetadataProvider() ) diff --git a/compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirMetadataSerializer.kt b/compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirMetadataSerializer.kt index d17cc67687d..4603a7d3fae 100644 --- a/compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirMetadataSerializer.kt +++ b/compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirMetadataSerializer.kt @@ -51,7 +51,7 @@ fun makeFirMetadataSerializerForIrClass( (it.owner.metadata as? FirMetadataSource.Property)?.fir?.copyToFreeProperty(approximator) } ?: emptyList() val firSerializerExtension = FirJvmSerializerExtension( - session, serializationBindings, context.state, irClass.metadata, localDelegatedProperties, + session, serializationBindings, context.state, irClass.metadata, localDelegatedProperties, context.isEnclosedInConstructor.toList(), approximator, context.defaultTypeMapper, components ) return FirMetadataSerializer( diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java index 26dc6e14104..9f6ebb560b4 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java @@ -45477,6 +45477,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr runTest("compiler/testData/codegen/box/reflection/jvmKTypeCaching.kt"); } + @Test + @TestMetadata("kt63988.kt") + public void testKt63988() throws Exception { + runTest("compiler/testData/codegen/box/reflection/kt63988.kt"); + } + @Nested @TestMetadata("compiler/testData/codegen/box/reflection/annotations") @TestDataPath("$PROJECT_ROOT") @@ -47451,6 +47457,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr public void testLocalClassesAndAnonymousObjects() throws Exception { runTest("compiler/testData/codegen/box/reflection/localClasses/localClassesAndAnonymousObjects.kt"); } + + @Test + @TestMetadata("localNestedClasses.kt") + public void testLocalNestedClasses() throws Exception { + runTest("compiler/testData/codegen/box/reflection/localClasses/localNestedClasses.kt"); + } } @Nested diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated.java index 1c2be754276..31c5412bf1f 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated.java @@ -45477,6 +45477,12 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated runTest("compiler/testData/codegen/box/reflection/jvmKTypeCaching.kt"); } + @Test + @TestMetadata("kt63988.kt") + public void testKt63988() throws Exception { + runTest("compiler/testData/codegen/box/reflection/kt63988.kt"); + } + @Nested @TestMetadata("compiler/testData/codegen/box/reflection/annotations") @TestDataPath("$PROJECT_ROOT") @@ -47451,6 +47457,12 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated public void testLocalClassesAndAnonymousObjects() throws Exception { runTest("compiler/testData/codegen/box/reflection/localClasses/localClassesAndAnonymousObjects.kt"); } + + @Test + @TestMetadata("localNestedClasses.kt") + public void testLocalNestedClasses() throws Exception { + runTest("compiler/testData/codegen/box/reflection/localClasses/localNestedClasses.kt"); + } } @Nested diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java index 05916bfa6fa..2e620aad9e4 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java @@ -45477,6 +45477,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo runTest("compiler/testData/codegen/box/reflection/jvmKTypeCaching.kt"); } + @Test + @TestMetadata("kt63988.kt") + public void testKt63988() throws Exception { + runTest("compiler/testData/codegen/box/reflection/kt63988.kt"); + } + @Nested @TestMetadata("compiler/testData/codegen/box/reflection/annotations") @TestDataPath("$PROJECT_ROOT") @@ -47451,6 +47457,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo public void testLocalClassesAndAnonymousObjects() throws Exception { runTest("compiler/testData/codegen/box/reflection/localClasses/localClassesAndAnonymousObjects.kt"); } + + @Test + @TestMetadata("localNestedClasses.kt") + public void testLocalNestedClasses() throws Exception { + runTest("compiler/testData/codegen/box/reflection/localClasses/localNestedClasses.kt"); + } } @Nested diff --git a/compiler/testData/codegen/box/closures/subclosuresWithinInitializers.jvm_abi.txt b/compiler/testData/codegen/box/closures/subclosuresWithinInitializers.jvm_abi.txt deleted file mode 100644 index a5cd2be5457..00000000000 --- a/compiler/testData/codegen/box/closures/subclosuresWithinInitializers.jvm_abi.txt +++ /dev/null @@ -1,9 +0,0 @@ -MODULE main - CLASS Outer$foo$Local.class - CLASS METADATA - PROPERTY getObj()LOuter$foo$Local$obj$1; - Property: class.metadata.property.returnType - K1 - .Outer$foo$Local$obj$1 - K2 - .Outer$foo$Local. diff --git a/compiler/testData/codegen/box/closures/subclosuresWithinInitializers.kt b/compiler/testData/codegen/box/closures/subclosuresWithinInitializers.kt index 2e2eebcc3e6..3f76b76193e 100644 --- a/compiler/testData/codegen/box/closures/subclosuresWithinInitializers.kt +++ b/compiler/testData/codegen/box/closures/subclosuresWithinInitializers.kt @@ -1,5 +1,3 @@ -// JVM_ABI_K1_K2_DIFF: KT-63868 - fun run(block: () -> R) = block() inline fun inlineRun(block: () -> R) = block() diff --git a/compiler/testData/codegen/box/compileKotlinAgainstKotlin/fir/AnonymousObjectInProperty.jvm_abi.txt b/compiler/testData/codegen/box/compileKotlinAgainstKotlin/fir/AnonymousObjectInProperty.jvm_abi.txt deleted file mode 100644 index b402008fde0..00000000000 --- a/compiler/testData/codegen/box/compileKotlinAgainstKotlin/fir/AnonymousObjectInProperty.jvm_abi.txt +++ /dev/null @@ -1,9 +0,0 @@ -MODULE lib - CLASS A.class - CLASS METADATA - PROPERTY x - Property: class.metadata.property.returnType - K1 - .A$x$1 - K2 - .A. diff --git a/compiler/testData/codegen/box/compileKotlinAgainstKotlin/fir/AnonymousObjectInProperty.kt b/compiler/testData/codegen/box/compileKotlinAgainstKotlin/fir/AnonymousObjectInProperty.kt index a1dce784cf3..59f6f1e2a20 100644 --- a/compiler/testData/codegen/box/compileKotlinAgainstKotlin/fir/AnonymousObjectInProperty.kt +++ b/compiler/testData/codegen/box/compileKotlinAgainstKotlin/fir/AnonymousObjectInProperty.kt @@ -1,6 +1,5 @@ // TARGET_BACKEND: JVM // MODULE: lib -// JVM_ABI_K1_K2_DIFF: KT-63868 // FILE: A.kt abstract class A { diff --git a/compiler/testData/codegen/box/innerNested/superConstructorCall/objectExtendsInnerOfLocalVarargAndDefault.jvm_abi.txt b/compiler/testData/codegen/box/innerNested/superConstructorCall/objectExtendsInnerOfLocalVarargAndDefault.jvm_abi.txt deleted file mode 100644 index b1c46cd30f7..00000000000 --- a/compiler/testData/codegen/box/innerNested/superConstructorCall/objectExtendsInnerOfLocalVarargAndDefault.jvm_abi.txt +++ /dev/null @@ -1,9 +0,0 @@ -MODULE main - CLASS ObjectExtendsInnerOfLocalVarargAndDefaultKt$box$Local.class - CLASS METADATA - PROPERTY getObj()LObjectExtendsInnerOfLocalVarargAndDefaultKt$box$Local$obj$1; - Property: class.metadata.property.returnType - K1 - .ObjectExtendsInnerOfLocalVarargAndDefaultKt$box$Local$obj$1 - K2 - .ObjectExtendsInnerOfLocalVarargAndDefaultKt$box$Local. diff --git a/compiler/testData/codegen/box/innerNested/superConstructorCall/objectExtendsInnerOfLocalVarargAndDefault.kt b/compiler/testData/codegen/box/innerNested/superConstructorCall/objectExtendsInnerOfLocalVarargAndDefault.kt index 35ee7a067e4..eef3131ae2b 100644 --- a/compiler/testData/codegen/box/innerNested/superConstructorCall/objectExtendsInnerOfLocalVarargAndDefault.kt +++ b/compiler/testData/codegen/box/innerNested/superConstructorCall/objectExtendsInnerOfLocalVarargAndDefault.kt @@ -1,4 +1,3 @@ -// JVM_ABI_K1_K2_DIFF: KT-63655 fun box(): String { val capture = "oh" diff --git a/compiler/testData/codegen/box/innerNested/superConstructorCall/objectExtendsInnerOfLocalWithCapture.jvm_abi.txt b/compiler/testData/codegen/box/innerNested/superConstructorCall/objectExtendsInnerOfLocalWithCapture.jvm_abi.txt deleted file mode 100644 index f9d98a945fd..00000000000 --- a/compiler/testData/codegen/box/innerNested/superConstructorCall/objectExtendsInnerOfLocalWithCapture.jvm_abi.txt +++ /dev/null @@ -1,9 +0,0 @@ -MODULE main - CLASS ObjectExtendsInnerOfLocalWithCaptureKt$box$Local.class - CLASS METADATA - PROPERTY getObj()LObjectExtendsInnerOfLocalWithCaptureKt$box$Local$obj$1; - Property: class.metadata.property.returnType - K1 - .ObjectExtendsInnerOfLocalWithCaptureKt$box$Local$obj$1 - K2 - .ObjectExtendsInnerOfLocalWithCaptureKt$box$Local. diff --git a/compiler/testData/codegen/box/innerNested/superConstructorCall/objectExtendsInnerOfLocalWithCapture.kt b/compiler/testData/codegen/box/innerNested/superConstructorCall/objectExtendsInnerOfLocalWithCapture.kt index 794d1c746de..b4fb7a47cee 100644 --- a/compiler/testData/codegen/box/innerNested/superConstructorCall/objectExtendsInnerOfLocalWithCapture.kt +++ b/compiler/testData/codegen/box/innerNested/superConstructorCall/objectExtendsInnerOfLocalWithCapture.kt @@ -1,4 +1,3 @@ -// JVM_ABI_K1_K2_DIFF: KT-63655 fun box(): String { class Local { open inner class Inner(val s: String) { diff --git a/compiler/testData/codegen/box/javaInterop/kt43217.jvm_abi.txt b/compiler/testData/codegen/box/javaInterop/kt43217.jvm_abi.txt deleted file mode 100644 index aceb17bc93e..00000000000 --- a/compiler/testData/codegen/box/javaInterop/kt43217.jvm_abi.txt +++ /dev/null @@ -1,9 +0,0 @@ -MODULE main - CLASS A.class - CLASS METADATA - PROPERTY b - Property: class.metadata.property.returnType - K1 - .A$b$1 - K2 - .A. diff --git a/compiler/testData/codegen/box/javaInterop/kt43217.kt b/compiler/testData/codegen/box/javaInterop/kt43217.kt index 72c57555fed..4984f51a120 100644 --- a/compiler/testData/codegen/box/javaInterop/kt43217.kt +++ b/compiler/testData/codegen/box/javaInterop/kt43217.kt @@ -1,6 +1,5 @@ // TARGET_BACKEND: JVM // JVM_TARGET: 1.8 -// JVM_ABI_K1_K2_DIFF: KT-63655 // FILE: kt43217.kt diff --git a/compiler/testData/codegen/box/localClasses/localClassInInitializer.jvm_abi.txt b/compiler/testData/codegen/box/localClasses/localClassInInitializer.jvm_abi.txt deleted file mode 100644 index 4d06b4f88ee..00000000000 --- a/compiler/testData/codegen/box/localClasses/localClassInInitializer.jvm_abi.txt +++ /dev/null @@ -1,8 +0,0 @@ -MODULE main - CLASS A$o$1.class - CLASS METADATA - Property: class.metadata.superTypes - K1 - [.A$B] - K2 - [.A.B] diff --git a/compiler/testData/codegen/box/localClasses/localClassInInitializer.kt b/compiler/testData/codegen/box/localClasses/localClassInInitializer.kt index 36007e18872..0dafae38048 100644 --- a/compiler/testData/codegen/box/localClasses/localClassInInitializer.kt +++ b/compiler/testData/codegen/box/localClasses/localClassInInitializer.kt @@ -1,5 +1,3 @@ -// JVM_ABI_K1_K2_DIFF: KT-63901 - class A { var a: String = "Fail" diff --git a/compiler/testData/codegen/box/objects/compoundAssignmentToPropertyWithQualifier.jvm_abi.txt b/compiler/testData/codegen/box/objects/compoundAssignmentToPropertyWithQualifier.jvm_abi.txt deleted file mode 100644 index af0acdcb799..00000000000 --- a/compiler/testData/codegen/box/objects/compoundAssignmentToPropertyWithQualifier.jvm_abi.txt +++ /dev/null @@ -1,9 +0,0 @@ -MODULE main - CLASS CompoundAssignmentToPropertyWithQualifierKt$box$c$1.class - CLASS METADATA - PROPERTY getB()LCompoundAssignmentToPropertyWithQualifierKt$box$c$1$b$1; - Property: class.metadata.property.returnType - K1 - .CompoundAssignmentToPropertyWithQualifierKt$box$c$1$b$1 - K2 - .CompoundAssignmentToPropertyWithQualifierKt$box$c$1. diff --git a/compiler/testData/codegen/box/objects/compoundAssignmentToPropertyWithQualifier.kt b/compiler/testData/codegen/box/objects/compoundAssignmentToPropertyWithQualifier.kt index 8b271f6917a..bc00799ec27 100644 --- a/compiler/testData/codegen/box/objects/compoundAssignmentToPropertyWithQualifier.kt +++ b/compiler/testData/codegen/box/objects/compoundAssignmentToPropertyWithQualifier.kt @@ -1,5 +1,3 @@ -// JVM_ABI_K1_K2_DIFF: KT-63655 - var log = "" class A(p: String) { diff --git a/compiler/testData/codegen/box/objects/kt1136.jvm_abi.txt b/compiler/testData/codegen/box/objects/kt1136.jvm_abi.txt index 0e9d3a26734..52b856f67df 100644 --- a/compiler/testData/codegen/box/objects/kt1136.jvm_abi.txt +++ b/compiler/testData/codegen/box/objects/kt1136.jvm_abi.txt @@ -7,12 +7,6 @@ MODULE main java/util/ArrayList /* = kotlin/collections/ArrayList^ */ K2 java/util/ArrayList - PROPERTY workerThread - Property: class.metadata.property.returnType - K1 - .SomeClass$workerThread$1 - K2 - .SomeClass. CLASS SomeClass$Inner.class CLASS METADATA PROPERTY getCopy()Ljava/util/ArrayList; diff --git a/compiler/testData/codegen/box/objects/kt1136.kt b/compiler/testData/codegen/box/objects/kt1136.kt index 22bbdc22342..791ec042730 100644 --- a/compiler/testData/codegen/box/objects/kt1136.kt +++ b/compiler/testData/codegen/box/objects/kt1136.kt @@ -1,5 +1,5 @@ // TARGET_BACKEND: JVM -// JVM_ABI_K1_K2_DIFF: KT-63655, KT-63864 +// JVM_ABI_K1_K2_DIFF: KT-63864 public object SomeObject { private val workerThread = object : Thread() { override fun run() { diff --git a/compiler/testData/codegen/box/objects/objectInLocalAnonymousObject.jvm_abi.txt b/compiler/testData/codegen/box/objects/objectInLocalAnonymousObject.jvm_abi.txt deleted file mode 100644 index 72e41a297f0..00000000000 --- a/compiler/testData/codegen/box/objects/objectInLocalAnonymousObject.jvm_abi.txt +++ /dev/null @@ -1,9 +0,0 @@ -MODULE main - CLASS ObjectInLocalAnonymousObjectKt$box$foo$1.class - CLASS METADATA - PROPERTY getBar()LObjectInLocalAnonymousObjectKt$box$foo$1$bar$1; - Property: class.metadata.property.returnType - K1 - .ObjectInLocalAnonymousObjectKt$box$foo$1$bar$1 - K2 - .ObjectInLocalAnonymousObjectKt$box$foo$1. diff --git a/compiler/testData/codegen/box/objects/objectInLocalAnonymousObject.kt b/compiler/testData/codegen/box/objects/objectInLocalAnonymousObject.kt index c85892c23b9..f21c93edf75 100644 --- a/compiler/testData/codegen/box/objects/objectInLocalAnonymousObject.kt +++ b/compiler/testData/codegen/box/objects/objectInLocalAnonymousObject.kt @@ -1,4 +1,3 @@ -// JVM_ABI_K1_K2_DIFF: KT-63655 fun box(): String { var boo = "OK" var foo = object { diff --git a/compiler/testData/codegen/box/objects/objectLiteralInClass.jvm_abi.txt b/compiler/testData/codegen/box/objects/objectLiteralInClass.jvm_abi.txt deleted file mode 100644 index 9bbc8b8e8e2..00000000000 --- a/compiler/testData/codegen/box/objects/objectLiteralInClass.jvm_abi.txt +++ /dev/null @@ -1,9 +0,0 @@ -MODULE main - CLASS C.class - CLASS METADATA - PROPERTY localObject - Property: class.metadata.property.returnType - K1 - .C$localObject$1 - K2 - .C. diff --git a/compiler/testData/codegen/box/objects/objectLiteralInClass.kt b/compiler/testData/codegen/box/objects/objectLiteralInClass.kt index 246148d1465..db32a1dab6a 100644 --- a/compiler/testData/codegen/box/objects/objectLiteralInClass.kt +++ b/compiler/testData/codegen/box/objects/objectLiteralInClass.kt @@ -1,4 +1,3 @@ -// JVM_ABI_K1_K2_DIFF: KT-63655 class C { val s = "OK" diff --git a/compiler/testData/codegen/box/objects/substitutionFunctionFromSuper.jvm_abi.txt b/compiler/testData/codegen/box/objects/substitutionFunctionFromSuper.jvm_abi.txt deleted file mode 100644 index dc883806c5d..00000000000 --- a/compiler/testData/codegen/box/objects/substitutionFunctionFromSuper.jvm_abi.txt +++ /dev/null @@ -1,9 +0,0 @@ -MODULE main - CLASS Outer.class - CLASS METADATA - PROPERTY obj - Property: class.metadata.property.returnType - K1 - .Outer$obj$1 - K2 - .Outer. diff --git a/compiler/testData/codegen/box/objects/substitutionFunctionFromSuper.kt b/compiler/testData/codegen/box/objects/substitutionFunctionFromSuper.kt index 1e777766e0e..2fcf8267a8d 100644 --- a/compiler/testData/codegen/box/objects/substitutionFunctionFromSuper.kt +++ b/compiler/testData/codegen/box/objects/substitutionFunctionFromSuper.kt @@ -1,5 +1,4 @@ // KT-44054 -// JVM_ABI_K1_K2_DIFF: KT-63655 enum class Enum { Entry1, Entry2 diff --git a/compiler/testData/codegen/box/objects/useAnonymousObjectFunction.jvm_abi.txt b/compiler/testData/codegen/box/objects/useAnonymousObjectFunction.jvm_abi.txt deleted file mode 100644 index 46ecaa91095..00000000000 --- a/compiler/testData/codegen/box/objects/useAnonymousObjectFunction.jvm_abi.txt +++ /dev/null @@ -1,15 +0,0 @@ -MODULE main - CLASS Outer.class - CLASS METADATA - PROPERTY obj1 - Property: class.metadata.property.returnType - K1 - .Outer$obj1$1 - K2 - .Outer. - PROPERTY obj2 - Property: class.metadata.property.returnType - K1 - .Outer$obj2$1 - K2 - .Outer. diff --git a/compiler/testData/codegen/box/objects/useAnonymousObjectFunction.kt b/compiler/testData/codegen/box/objects/useAnonymousObjectFunction.kt index 03fb85f22af..55c14d901d3 100644 --- a/compiler/testData/codegen/box/objects/useAnonymousObjectFunction.kt +++ b/compiler/testData/codegen/box/objects/useAnonymousObjectFunction.kt @@ -1,6 +1,4 @@ // KT-44050 -// JVM_ABI_K1_K2_DIFF: KT-63655 - enum class Enum { Entry1() { fun bogus() = 42 diff --git a/compiler/testData/codegen/box/polymorphicSignature/invoke.jvm_abi.txt b/compiler/testData/codegen/box/polymorphicSignature/invoke.jvm_abi.txt deleted file mode 100644 index 1a09cfbd625..00000000000 --- a/compiler/testData/codegen/box/polymorphicSignature/invoke.jvm_abi.txt +++ /dev/null @@ -1,9 +0,0 @@ -MODULE main - CLASS InvokeKt$box$o$1.class - CLASS METADATA - PROPERTY getP()LInvokeKt$box$o$1$p$1; - Property: class.metadata.property.returnType - K1 - .InvokeKt$box$o$1$p$1 - K2 - .InvokeKt$box$o$1. diff --git a/compiler/testData/codegen/box/polymorphicSignature/invoke.kt b/compiler/testData/codegen/box/polymorphicSignature/invoke.kt index ded8077534b..4496889de66 100644 --- a/compiler/testData/codegen/box/polymorphicSignature/invoke.kt +++ b/compiler/testData/codegen/box/polymorphicSignature/invoke.kt @@ -3,7 +3,6 @@ // FULL_JDK // SKIP_JDK6 // WITH_STDLIB -// JVM_ABI_K1_K2_DIFF: KT-63655 import java.lang.invoke.MethodHandles import java.lang.invoke.MethodType diff --git a/compiler/testData/codegen/box/reflection/kt63988.kt b/compiler/testData/codegen/box/reflection/kt63988.kt new file mode 100644 index 00000000000..14a29d383d0 --- /dev/null +++ b/compiler/testData/codegen/box/reflection/kt63988.kt @@ -0,0 +1,12 @@ +// TARGET_BACKEND: JVM_IR +// WITH_REFLECT + +import kotlin.reflect.full.memberProperties + +class A { + val prop = object { + val nestedProp = object {} + } +} + +fun box() = if (A().prop::class.memberProperties.size == 1) "OK" else "Fail" \ No newline at end of file diff --git a/compiler/testData/codegen/box/reflection/localClasses/localNestedClasses.jvm_abi.txt b/compiler/testData/codegen/box/reflection/localClasses/localNestedClasses.jvm_abi.txt new file mode 100644 index 00000000000..8dc80552e6d --- /dev/null +++ b/compiler/testData/codegen/box/reflection/localClasses/localNestedClasses.jvm_abi.txt @@ -0,0 +1,15 @@ +MODULE main + CLASS LocalNestedClassesKt$foo1$X$Y.class + CLASS METADATA + Property: class.metadata.companionObject + K1 + null + K2 + Z + CLASS LocalNestedClassesKt$foo2$X$Y.class + CLASS METADATA + Property: class.metadata.companionObject + K1 + null + K2 + Companion diff --git a/compiler/testData/codegen/box/reflection/localClasses/localNestedClasses.kt b/compiler/testData/codegen/box/reflection/localClasses/localNestedClasses.kt new file mode 100644 index 00000000000..6868c176ac6 --- /dev/null +++ b/compiler/testData/codegen/box/reflection/localClasses/localNestedClasses.kt @@ -0,0 +1,144 @@ +// TARGET_BACKEND: JVM_IR +// WITH_REFLECT +// JVM_ABI_K1_K2_DIFF: K2 names companion objects in metadata correctly + +import kotlin.reflect.KType +import kotlin.reflect.full.memberProperties + +val KType.str get() = classifier.toString() + +class A { + fun foo(): String { + class Nested { + inner class Inner { + val prop = this + } + } + return Nested().Inner()::class.memberProperties.iterator().next().returnType.str + } +} + +fun foo1(): String { + class X { + inner class Y { + companion object Z + + val prop = Z + } + } + return X.Y::class.memberProperties.iterator().next().returnType.str +} + +fun foo2(): String { + class X { + inner class Y { + companion object + + val prop = Companion + } + } + return X.Y::class.memberProperties.iterator().next().returnType.str +} + +fun foo3(): String { + class X { + inner class Y { + val prop = object {} + } + } + return X.Y::class.memberProperties.iterator().next().returnType.str +} + +fun foo4(): String { + var res = "" + + class A { + inner class B { + inner class C { + fun bar() { + class D { + val prop = this + } + res = D::class.memberProperties.iterator().next().returnType.str + } + + init { + bar() + } + } + } + } + A().B().C() + return res +} + +fun foo5(): String { + var res = "" + object { + fun bar() { + return object { + fun foo() { + class A { + inner class B { + val prop = this + init { + res = prop::class.memberProperties.iterator().next().returnType.str + } + } + } + A().B() + } + }.foo() + } + }.bar() + return res +} + +fun foo6(): String { + var res = "" + object { + fun bar() { + class A { + inner class B { + inner class C { + val prop = this + + init { + res = prop::class.memberProperties.iterator().next().returnType.str + } + } + } + } + A().B().C() + } + }.bar() + return res +} + +fun foo7(): String { + var res = "" + val x = object { + val y = object { + val z = object { + val y = this + init { + res = this::class.memberProperties.iterator().next().returnType.str + } + } + } + } + return res +} + +fun box(): String { + if (A().foo() != "class A\$foo\$Nested\$Inner") return "Fail 1" + if (foo1() != "class LocalNestedClassesKt\$foo1\$X\$Y\$Z") return "Fail 2" + if (foo2() != "class LocalNestedClassesKt\$foo2\$X\$Y\$Companion") return "Fail 3" + if (foo3() != "class LocalNestedClassesKt\$foo3\$X\$Y\$prop\$1") return "Fail 4" + if (foo4() != "class LocalNestedClassesKt\$foo4\$A\$B\$C\$bar\$D") return "Fail 5" + if (foo5() != "class LocalNestedClassesKt\$foo5\$1\$bar\$1\$foo\$A\$B") return "Fail 6" + if (foo6() != "class LocalNestedClassesKt\$foo6\$1\$bar\$A\$B\$C") return "Fail 7" + if (foo7() != "class LocalNestedClassesKt\$foo7\$x\$1\$y\$1\$z\$1") return "Fail 8" + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/regressions/kt3850.jvm_abi.txt b/compiler/testData/codegen/box/regressions/kt3850.jvm_abi.txt deleted file mode 100644 index 7f0a1d46e92..00000000000 --- a/compiler/testData/codegen/box/regressions/kt3850.jvm_abi.txt +++ /dev/null @@ -1,9 +0,0 @@ -MODULE main - CLASS One.class - CLASS METADATA - PROPERTY getA1()[LOne$a1$1; - Property: class.metadata.property.returnType - K1 - kotlin/Array<.One$a1$1> - K2 - kotlin/Array<.One.> diff --git a/compiler/testData/codegen/box/regressions/kt3850.kt b/compiler/testData/codegen/box/regressions/kt3850.kt index 8ed257c1c8e..007dc26fb5e 100644 --- a/compiler/testData/codegen/box/regressions/kt3850.kt +++ b/compiler/testData/codegen/box/regressions/kt3850.kt @@ -2,7 +2,6 @@ // In light analysis mode, anonymous object type is approximated to the supertype, so `fy` is unresolved. // IGNORE_LIGHT_ANALYSIS -// JVM_ABI_K1_K2_DIFF: KT-63655 private class One { val a1 = arrayOf( diff --git a/compiler/testData/codegen/box/super/superConstructor/objectExtendsLocalInner.jvm_abi.txt b/compiler/testData/codegen/box/super/superConstructor/objectExtendsLocalInner.jvm_abi.txt deleted file mode 100644 index c8e9f9e0d92..00000000000 --- a/compiler/testData/codegen/box/super/superConstructor/objectExtendsLocalInner.jvm_abi.txt +++ /dev/null @@ -1,9 +0,0 @@ -MODULE main - CLASS ObjectExtendsLocalInnerKt$box$Local.class - CLASS METADATA - PROPERTY getObj()LObjectExtendsLocalInnerKt$box$Local$obj$1; - Property: class.metadata.property.returnType - K1 - .ObjectExtendsLocalInnerKt$box$Local$obj$1 - K2 - .ObjectExtendsLocalInnerKt$box$Local. diff --git a/compiler/testData/codegen/box/super/superConstructor/objectExtendsLocalInner.kt b/compiler/testData/codegen/box/super/superConstructor/objectExtendsLocalInner.kt index d4a49596050..ab3c695f278 100644 --- a/compiler/testData/codegen/box/super/superConstructor/objectExtendsLocalInner.kt +++ b/compiler/testData/codegen/box/super/superConstructor/objectExtendsLocalInner.kt @@ -1,4 +1,3 @@ -// JVM_ABI_K1_K2_DIFF: KT-63655 fun box(): String { val capture = "O" diff --git a/compiler/testData/codegen/bytecodeListing/kt43217.jvm_abi.txt b/compiler/testData/codegen/bytecodeListing/kt43217.jvm_abi.txt deleted file mode 100644 index aceb17bc93e..00000000000 --- a/compiler/testData/codegen/bytecodeListing/kt43217.jvm_abi.txt +++ /dev/null @@ -1,9 +0,0 @@ -MODULE main - CLASS A.class - CLASS METADATA - PROPERTY b - Property: class.metadata.property.returnType - K1 - .A$b$1 - K2 - .A. diff --git a/compiler/testData/codegen/bytecodeListing/kt43217.kt b/compiler/testData/codegen/bytecodeListing/kt43217.kt index 74605128b39..825e4360629 100644 --- a/compiler/testData/codegen/bytecodeListing/kt43217.kt +++ b/compiler/testData/codegen/bytecodeListing/kt43217.kt @@ -1,5 +1,4 @@ // JVM_TARGET: 1.8 -// JVM_ABI_K1_K2_DIFF: KT-63655 // FILE: kt43217.kt class A { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/JvmAbiConsistencyTestBoxGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/JvmAbiConsistencyTestBoxGenerated.java index a28e850e67f..8e41c29418e 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/JvmAbiConsistencyTestBoxGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/JvmAbiConsistencyTestBoxGenerated.java @@ -44793,6 +44793,12 @@ public class JvmAbiConsistencyTestBoxGenerated extends AbstractJvmAbiConsistency runTest("compiler/testData/codegen/box/reflection/jvmKTypeCaching.kt"); } + @Test + @TestMetadata("kt63988.kt") + public void testKt63988() throws Exception { + runTest("compiler/testData/codegen/box/reflection/kt63988.kt"); + } + @Nested @TestMetadata("compiler/testData/codegen/box/reflection/annotations") @TestDataPath("$PROJECT_ROOT") @@ -46767,6 +46773,12 @@ public class JvmAbiConsistencyTestBoxGenerated extends AbstractJvmAbiConsistency public void testLocalClassesAndAnonymousObjects() throws Exception { runTest("compiler/testData/codegen/box/reflection/localClasses/localClassesAndAnonymousObjects.kt"); } + + @Test + @TestMetadata("localNestedClasses.kt") + public void testLocalNestedClasses() throws Exception { + runTest("compiler/testData/codegen/box/reflection/localClasses/localNestedClasses.kt"); + } } @Nested diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index 527625b623c..c7712c6d3aa 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -44793,6 +44793,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/reflection/jvmKTypeCaching.kt"); } + @Test + @TestMetadata("kt63988.kt") + public void testKt63988() throws Exception { + runTest("compiler/testData/codegen/box/reflection/kt63988.kt"); + } + @Nested @TestMetadata("compiler/testData/codegen/box/reflection/annotations") @TestDataPath("$PROJECT_ROOT") @@ -46767,6 +46773,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes public void testLocalClassesAndAnonymousObjects() throws Exception { runTest("compiler/testData/codegen/box/reflection/localClasses/localClassesAndAnonymousObjects.kt"); } + + @Test + @TestMetadata("localNestedClasses.kt") + public void testLocalNestedClasses() throws Exception { + runTest("compiler/testData/codegen/box/reflection/localClasses/localNestedClasses.kt"); + } } @Nested diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java index 6fefb119cb5..8b61257d4e6 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java @@ -44793,6 +44793,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack runTest("compiler/testData/codegen/box/reflection/jvmKTypeCaching.kt"); } + @Test + @TestMetadata("kt63988.kt") + public void testKt63988() throws Exception { + runTest("compiler/testData/codegen/box/reflection/kt63988.kt"); + } + @Nested @TestMetadata("compiler/testData/codegen/box/reflection/annotations") @TestDataPath("$PROJECT_ROOT") @@ -46767,6 +46773,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack public void testLocalClassesAndAnonymousObjects() throws Exception { runTest("compiler/testData/codegen/box/reflection/localClasses/localClassesAndAnonymousObjects.kt"); } + + @Test + @TestMetadata("localNestedClasses.kt") + public void testLocalNestedClasses() throws Exception { + runTest("compiler/testData/codegen/box/reflection/localClasses/localNestedClasses.kt"); + } } @Nested diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index de9e4786918..8bdeee16d41 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -35564,6 +35564,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/reflection/jvmKTypeCaching.kt"); } + @TestMetadata("kt63988.kt") + public void testKt63988() throws Exception { + runTest("compiler/testData/codegen/box/reflection/kt63988.kt"); + } + @TestMetadata("compiler/testData/codegen/box/reflection/annotations") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -37324,6 +37329,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes public void testLocalClassesAndAnonymousObjects() throws Exception { runTest("compiler/testData/codegen/box/reflection/localClasses/localClassesAndAnonymousObjects.kt"); } + + @TestMetadata("localNestedClasses.kt") + public void testLocalNestedClasses() throws Exception { + runTest("compiler/testData/codegen/box/reflection/localClasses/localNestedClasses.kt"); + } } @TestMetadata("compiler/testData/codegen/box/reflection/mapping") diff --git a/libraries/tools/kotlinp/testData/localClasses/DeepInnerLocalChain.kt b/libraries/tools/kotlinp/testData/localClasses/DeepInnerLocalChain.kt index ea69e1f17c2..822fa79fe24 100644 --- a/libraries/tools/kotlinp/testData/localClasses/DeepInnerLocalChain.kt +++ b/libraries/tools/kotlinp/testData/localClasses/DeepInnerLocalChain.kt @@ -1,5 +1,3 @@ -// IGNORE K2 -// ^ KT-63655 K2: incorrect short class name in metadata for anonymous object inside a local class fun test() { class Local { diff --git a/libraries/tools/kotlinp/testData/localClasses/LocalClassInConstructor.fir.txt b/libraries/tools/kotlinp/testData/localClasses/LocalClassInConstructor.fir.txt index edc99de4f4b..57d23e05fcf 100644 --- a/libraries/tools/kotlinp/testData/localClasses/LocalClassInConstructor.fir.txt +++ b/libraries/tools/kotlinp/testData/localClasses/LocalClassInConstructor.fir.txt @@ -9,13 +9,13 @@ public final class A : kotlin/Any { } // A$L.class // ------------------------------------------ -local final class .A.L : kotlin/Any { +local final class .A$L : kotlin/Any { // signature: ()V public constructor() // signature: x(LA$L;)V - public final fun x(l: .A.L<.A.L.I>): kotlin/Unit + public final fun x(l: .A$L<.A.L.I>): kotlin/Unit // nested class: I