diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/ClassMemberGenerator.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/ClassMemberGenerator.kt index 27db08a590e..3211b238dfa 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/ClassMemberGenerator.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/ClassMemberGenerator.kt @@ -6,6 +6,7 @@ package org.jetbrains.kotlin.fir.backend.generators import org.jetbrains.kotlin.descriptors.PropertyDescriptor +import org.jetbrains.kotlin.descriptors.Visibilities import org.jetbrains.kotlin.fir.backend.* import org.jetbrains.kotlin.fir.declarations.* import org.jetbrains.kotlin.fir.declarations.impl.FirDefaultPropertyGetter @@ -73,9 +74,20 @@ internal class ClassMemberGenerator( processedCallableNames += DataClassMembersGenerator(components).generateDataClassMembers(klass, irClass) } with(fakeOverrideGenerator) { irClass.addFakeOverrides(klass, processedCallableNames) } - klass.declarations.forEach { - if (it !is FirTypeAlias && (it !is FirConstructor || !it.isPrimary)) { - it.accept(visitor, null) + klass.declarations.forEach { declaration -> + when { + declaration is FirTypeAlias -> { + } + declaration is FirConstructor && declaration.isPrimary -> { + } + declaration is FirRegularClass && declaration.visibility == Visibilities.LOCAL -> { + val irNestedClass = classifierStorage.getCachedIrClass(declaration)!! + irNestedClass.parent = irClass + conversionScope.withParent(irNestedClass) { + convertClassContent(irNestedClass, declaration) + } + } + else -> declaration.accept(visitor, null) } } annotationGenerator.generate(irClass, klass) diff --git a/compiler/testData/codegen/box/classes/kt2607.kt b/compiler/testData/codegen/box/classes/kt2607.kt index 1d89bb92021..10688476918 100644 --- a/compiler/testData/codegen/box/classes/kt2607.kt +++ b/compiler/testData/codegen/box/classes/kt2607.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun box() : String { val o = object { diff --git a/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/constructorParameterAndLocalCapturedInLambdaInLocalClass.kt b/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/constructorParameterAndLocalCapturedInLambdaInLocalClass.kt index 873ae0b1d2d..56909dc9578 100644 --- a/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/constructorParameterAndLocalCapturedInLambdaInLocalClass.kt +++ b/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/constructorParameterAndLocalCapturedInLambdaInLocalClass.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR open class Base(val fn: () -> String) fun box(): String { diff --git a/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/constructorParameterCapturedInLambdaInLocalClass.kt b/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/constructorParameterCapturedInLambdaInLocalClass.kt index a9264ec8f56..7e9ab06f9da 100644 --- a/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/constructorParameterCapturedInLambdaInLocalClass.kt +++ b/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/constructorParameterCapturedInLambdaInLocalClass.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR open class Base(val fn: () -> String) fun box(): String { diff --git a/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/constructorParameterCapturedInLambdaInLocalClass2.kt b/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/constructorParameterCapturedInLambdaInLocalClass2.kt index c474a8581da..ee3f6949825 100644 --- a/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/constructorParameterCapturedInLambdaInLocalClass2.kt +++ b/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/constructorParameterCapturedInLambdaInLocalClass2.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR open class Base(val fn: () -> String) fun box(): String { diff --git a/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/localCapturedInLambdaInInnerClassInLocalClass.kt b/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/localCapturedInLambdaInInnerClassInLocalClass.kt index 60bd8453ca3..38ec2b6e3c9 100644 --- a/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/localCapturedInLambdaInInnerClassInLocalClass.kt +++ b/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/localCapturedInLambdaInInnerClassInLocalClass.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR open class Base(val fn: () -> String) fun box(): String { diff --git a/compiler/testData/codegen/box/defaultArguments/constructor/kt2852.kt b/compiler/testData/codegen/box/defaultArguments/constructor/kt2852.kt index 2481cebda2b..9a5434a99cf 100644 --- a/compiler/testData/codegen/box/defaultArguments/constructor/kt2852.kt +++ b/compiler/testData/codegen/box/defaultArguments/constructor/kt2852.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun box(): String { val o = object { inner class A(val value: String = "OK") diff --git a/compiler/testData/codegen/box/innerNested/superConstructorCall/objectExtendsInnerOfLocalWithCapture.kt b/compiler/testData/codegen/box/innerNested/superConstructorCall/objectExtendsInnerOfLocalWithCapture.kt index 344717c9b33..b4fb7a47cee 100644 --- a/compiler/testData/codegen/box/innerNested/superConstructorCall/objectExtendsInnerOfLocalWithCapture.kt +++ b/compiler/testData/codegen/box/innerNested/superConstructorCall/objectExtendsInnerOfLocalWithCapture.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun box(): String { class Local { open inner class Inner(val s: String) { diff --git a/compiler/testData/codegen/box/localClasses/closureOfInnerLocalClass.kt b/compiler/testData/codegen/box/localClasses/closureOfInnerLocalClass.kt index d51d13a3277..2e1c3cf367b 100644 --- a/compiler/testData/codegen/box/localClasses/closureOfInnerLocalClass.kt +++ b/compiler/testData/codegen/box/localClasses/closureOfInnerLocalClass.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // Enable for JVM backend when KT-8120 gets fixed // IGNORE_BACKEND: JVM diff --git a/compiler/testData/codegen/box/localClasses/closureWithSelfInstantiation.kt b/compiler/testData/codegen/box/localClasses/closureWithSelfInstantiation.kt index 67acd7f570b..20727829c28 100644 --- a/compiler/testData/codegen/box/localClasses/closureWithSelfInstantiation.kt +++ b/compiler/testData/codegen/box/localClasses/closureWithSelfInstantiation.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // Enable for JVM backend when KT-8120 gets fixed // IGNORE_BACKEND: JVM diff --git a/compiler/testData/codegen/box/localClasses/innerClassInLocalClass.kt b/compiler/testData/codegen/box/localClasses/innerClassInLocalClass.kt index a8553084c98..72d84e5ddac 100644 --- a/compiler/testData/codegen/box/localClasses/innerClassInLocalClass.kt +++ b/compiler/testData/codegen/box/localClasses/innerClassInLocalClass.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class A { val a = 1 fun calc () : Int { diff --git a/compiler/testData/codegen/box/localClasses/innerOfLocalCaptureExtensionReceiver.kt b/compiler/testData/codegen/box/localClasses/innerOfLocalCaptureExtensionReceiver.kt index 7bce1daf754..ba3a0df632a 100644 --- a/compiler/testData/codegen/box/localClasses/innerOfLocalCaptureExtensionReceiver.kt +++ b/compiler/testData/codegen/box/localClasses/innerOfLocalCaptureExtensionReceiver.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun String.bar(): String { open class Local { fun result() = this@bar diff --git a/compiler/testData/codegen/box/localClasses/ownClosureOfInnerLocalClass.kt b/compiler/testData/codegen/box/localClasses/ownClosureOfInnerLocalClass.kt index 3998e09538c..a9bbbcf9bad 100644 --- a/compiler/testData/codegen/box/localClasses/ownClosureOfInnerLocalClass.kt +++ b/compiler/testData/codegen/box/localClasses/ownClosureOfInnerLocalClass.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun box(): String { var log = ""