[IR] WIP
diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxInlineCodegenWithBytecodeInlinerTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxInlineCodegenWithBytecodeInlinerTestGenerated.java
index ee0a6a2..3ce2af1 100644
--- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxInlineCodegenWithBytecodeInlinerTestGenerated.java
+++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxInlineCodegenWithBytecodeInlinerTestGenerated.java
@@ -465,6 +465,12 @@
     }
 
     @Test
+    @TestMetadata("localClassExtraction.kt")
+    public void testLocalClassExtraction() {
+      runTest("compiler/testData/codegen/boxInline/anonymousObject/localClassExtraction.kt");
+    }
+
+    @Test
     @TestMetadata("objectInLambdaCapturesAnotherObject.kt")
     public void testObjectInLambdaCapturesAnotherObject() {
       runTest("compiler/testData/codegen/boxInline/anonymousObject/objectInLambdaCapturesAnotherObject.kt");
diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxInlineCodegenWithIrInlinerTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxInlineCodegenWithIrInlinerTestGenerated.java
index eb2a74e..8a4c471e 100644
--- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxInlineCodegenWithIrInlinerTestGenerated.java
+++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxInlineCodegenWithIrInlinerTestGenerated.java
@@ -465,6 +465,12 @@
     }
 
     @Test
+    @TestMetadata("localClassExtraction.kt")
+    public void testLocalClassExtraction() {
+      runTest("compiler/testData/codegen/boxInline/anonymousObject/localClassExtraction.kt");
+    }
+
+    @Test
     @TestMetadata("objectInLambdaCapturesAnotherObject.kt")
     public void testObjectInLambdaCapturesAnotherObject() {
       runTest("compiler/testData/codegen/boxInline/anonymousObject/objectInLambdaCapturesAnotherObject.kt");
diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeSerializeCompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeSerializeCompileKotlinAgainstInlineKotlinTestGenerated.java
index 5aa926a..94294f9 100644
--- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeSerializeCompileKotlinAgainstInlineKotlinTestGenerated.java
+++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeSerializeCompileKotlinAgainstInlineKotlinTestGenerated.java
@@ -465,6 +465,12 @@
     }
 
     @Test
+    @TestMetadata("localClassExtraction.kt")
+    public void testLocalClassExtraction() {
+      runTest("compiler/testData/codegen/boxInline/anonymousObject/localClassExtraction.kt");
+    }
+
+    @Test
     @TestMetadata("objectInLambdaCapturesAnotherObject.kt")
     public void testObjectInLambdaCapturesAnotherObject() {
       runTest("compiler/testData/codegen/boxInline/anonymousObject/objectInLambdaCapturesAnotherObject.kt");
diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxInlineCodegenWithBytecodeInlinerTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxInlineCodegenWithBytecodeInlinerTestGenerated.java
index 351b20a..493c18f 100644
--- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxInlineCodegenWithBytecodeInlinerTestGenerated.java
+++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxInlineCodegenWithBytecodeInlinerTestGenerated.java
@@ -465,6 +465,12 @@
     }
 
     @Test
+    @TestMetadata("localClassExtraction.kt")
+    public void testLocalClassExtraction() {
+      runTest("compiler/testData/codegen/boxInline/anonymousObject/localClassExtraction.kt");
+    }
+
+    @Test
     @TestMetadata("objectInLambdaCapturesAnotherObject.kt")
     public void testObjectInLambdaCapturesAnotherObject() {
       runTest("compiler/testData/codegen/boxInline/anonymousObject/objectInLambdaCapturesAnotherObject.kt");
diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxInlineCodegenWithIrInlinerTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxInlineCodegenWithIrInlinerTestGenerated.java
index 7ba6b90..c8f85e9 100644
--- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxInlineCodegenWithIrInlinerTestGenerated.java
+++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxInlineCodegenWithIrInlinerTestGenerated.java
@@ -465,6 +465,12 @@
     }
 
     @Test
+    @TestMetadata("localClassExtraction.kt")
+    public void testLocalClassExtraction() {
+      runTest("compiler/testData/codegen/boxInline/anonymousObject/localClassExtraction.kt");
+    }
+
+    @Test
     @TestMetadata("objectInLambdaCapturesAnotherObject.kt")
     public void testObjectInLambdaCapturesAnotherObject() {
       runTest("compiler/testData/codegen/boxInline/anonymousObject/objectInLambdaCapturesAnotherObject.kt");
diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiSerializeCompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiSerializeCompileKotlinAgainstInlineKotlinTestGenerated.java
index 4f0e95c..ae549b6 100644
--- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiSerializeCompileKotlinAgainstInlineKotlinTestGenerated.java
+++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiSerializeCompileKotlinAgainstInlineKotlinTestGenerated.java
@@ -465,6 +465,12 @@
     }
 
     @Test
+    @TestMetadata("localClassExtraction.kt")
+    public void testLocalClassExtraction() {
+      runTest("compiler/testData/codegen/boxInline/anonymousObject/localClassExtraction.kt");
+    }
+
+    @Test
     @TestMetadata("objectInLambdaCapturesAnotherObject.kt")
     public void testObjectInLambdaCapturesAnotherObject() {
       runTest("compiler/testData/codegen/boxInline/anonymousObject/objectInLambdaCapturesAnotherObject.kt");
diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/inline/LocalClasses.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/inline/LocalClasses.kt
index 04f7f14..83cc56b 100644
--- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/inline/LocalClasses.kt
+++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/inline/LocalClasses.kt
@@ -10,6 +10,7 @@
 import org.jetbrains.kotlin.backend.common.lower.LocalDeclarationsLowering
 import org.jetbrains.kotlin.backend.common.lower.locationForExtraction
 import org.jetbrains.kotlin.backend.common.lower.moveTo
+import org.jetbrains.kotlin.descriptors.DescriptorVisibilities
 import org.jetbrains.kotlin.ir.IrElement
 import org.jetbrains.kotlin.ir.IrStatement
 import org.jetbrains.kotlin.ir.declarations.*
@@ -186,7 +187,7 @@
 /**
  * Remaps symbols in local classes inside `this` to their corresponding lifted classes.
  */
-var IrFunction.localClassSymbolRemapper: DeepCopySymbolRemapper? by irAttribute(followAttributeOwner = false)
+var IrFunction.localClassSymbolRemapper: DeepCopySymbolRemapper? by irAttribute(followAttributeOwner = true)
 
 /**
  * Used to mark local classes for which we lifted their copies.
@@ -224,7 +225,12 @@
             // inlining we could use that same remapper to replace usages of local classes with usages of lifted classes.
             klass.acceptVoid(symbolRemapper)
             val classCopy = klass.transform(DeepCopyIrTreeWithSymbols(symbolRemapper), null) as IrClass
+
+            // Extracted local classes will only be shared across call sites in the same module,
+            classCopy.visibility = DescriptorVisibilities.INTERNAL
+
             classCopy.moveTo(locationForExtraction)
+            classCopy.patchDeclarationParents()
             klass.useExtractedCopy = true
         }
     }
diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/inline/SaveInlineFunctionsBeforeInlining.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/inline/SaveInlineFunctionsBeforeInlining.kt
index 5b60c33..eeb22c0 100644
--- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/inline/SaveInlineFunctionsBeforeInlining.kt
+++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/inline/SaveInlineFunctionsBeforeInlining.kt
@@ -7,13 +7,16 @@
 
 import org.jetbrains.kotlin.backend.common.DeclarationTransformer
 import org.jetbrains.kotlin.backend.common.getOrPut
+import org.jetbrains.kotlin.backend.common.lower.inline.localClassSymbolRemapper
 import org.jetbrains.kotlin.ir.backend.js.JsIrBackendContext
 import org.jetbrains.kotlin.ir.declarations.IrDeclaration
 import org.jetbrains.kotlin.ir.declarations.IrFunction
 import org.jetbrains.kotlin.ir.inline.InlineFunctionResolverReplacingCoroutineIntrinsics
 import org.jetbrains.kotlin.ir.inline.isConsideredAsPrivateForInlining
 import org.jetbrains.kotlin.ir.symbols.IrFunctionSymbol
-import org.jetbrains.kotlin.ir.util.deepCopyWithSymbols
+import org.jetbrains.kotlin.ir.util.DeepCopyIrTreeWithSymbols
+import org.jetbrains.kotlin.ir.util.DeepCopySymbolRemapper
+import org.jetbrains.kotlin.ir.visitors.acceptVoid
 
 // TODO: KT-67220: consider removing it
 internal class SaveInlineFunctionsBeforeInlining(
@@ -24,7 +27,12 @@
 
     override fun transformFlat(declaration: IrDeclaration): List<IrDeclaration>? {
         if (declaration is IrFunction && declaration.isInline && (!cacheOnlyPrivateFunctions || declaration.isConsideredAsPrivateForInlining())) {
-            inlineFunctionsBeforeInlining.getOrPut(declaration) { declaration.deepCopyWithSymbols(declaration.parent) }
+            inlineFunctionsBeforeInlining.getOrPut(declaration) {
+                val symbolRemapper = DeepCopySymbolRemapper()
+                declaration.acceptVoid(symbolRemapper)
+                declaration.localClassSymbolRemapper?.replaceKeys(symbolRemapper)
+                declaration.transform(DeepCopyIrTreeWithSymbols(symbolRemapper), null) as IrFunction
+            }
         }
 
         return null
diff --git a/compiler/ir/ir.inline/src/org/jetbrains/kotlin/ir/inline/FunctionInlining.kt b/compiler/ir/ir.inline/src/org/jetbrains/kotlin/ir/inline/FunctionInlining.kt
index b26e215..0a132df7 100644
--- a/compiler/ir/ir.inline/src/org/jetbrains/kotlin/ir/inline/FunctionInlining.kt
+++ b/compiler/ir/ir.inline/src/org/jetbrains/kotlin/ir/inline/FunctionInlining.kt
@@ -136,7 +136,7 @@
             produceOuterThisFields,
             // Only use lifted local classes if there's no cross-module inlining,
             // otherwise lifted local classes would become public ABI, which we don't want.
-            useLiftedLocalClasses = extractLocalClasses && currentFile.module == actualCallee.fileOrNull?.module,
+            useLiftedLocalClasses = extractLocalClasses && (containerScope?.irElement as? IrDeclaration)?.fileOrNull?.module == actualCallee.fileOrNull?.module,
         )
         return inliner.inline().markAsRegenerated()
     }
diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeepCopySymbolRemapper.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeepCopySymbolRemapper.kt
index f8d0d2a..0018ebe 100644
--- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeepCopySymbolRemapper.kt
+++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeepCopySymbolRemapper.kt
@@ -20,21 +20,21 @@
     private val descriptorsRemapper: DescriptorsRemapper = NullDescriptorsRemapper
 ) : IrElementVisitorVoid, SymbolRemapper {
 
-    protected val classes = hashMapOf<IrClassSymbol, IrClassSymbol>()
-    protected val scripts = hashMapOf<IrScriptSymbol, IrScriptSymbol>()
-    protected val constructors = hashMapOf<IrConstructorSymbol, IrConstructorSymbol>()
-    protected val enumEntries = hashMapOf<IrEnumEntrySymbol, IrEnumEntrySymbol>()
-    protected val externalPackageFragments = hashMapOf<IrExternalPackageFragmentSymbol, IrExternalPackageFragmentSymbol>()
-    protected val fields = hashMapOf<IrFieldSymbol, IrFieldSymbol>()
-    protected val files = hashMapOf<IrFileSymbol, IrFileSymbol>()
-    protected val functions = hashMapOf<IrSimpleFunctionSymbol, IrSimpleFunctionSymbol>()
-    protected val properties = hashMapOf<IrPropertySymbol, IrPropertySymbol>()
-    protected val returnableBlocks = hashMapOf<IrReturnableBlockSymbol, IrReturnableBlockSymbol>()
-    protected val typeParameters = hashMapOf<IrTypeParameterSymbol, IrTypeParameterSymbol>()
-    protected val valueParameters = hashMapOf<IrValueParameterSymbol, IrValueParameterSymbol>()
-    protected val variables = hashMapOf<IrVariableSymbol, IrVariableSymbol>()
-    protected val localDelegatedProperties = hashMapOf<IrLocalDelegatedPropertySymbol, IrLocalDelegatedPropertySymbol>()
-    protected val typeAliases = hashMapOf<IrTypeAliasSymbol, IrTypeAliasSymbol>()
+    protected var classes = hashMapOf<IrClassSymbol, IrClassSymbol>()
+    protected var scripts = hashMapOf<IrScriptSymbol, IrScriptSymbol>()
+    protected var constructors = hashMapOf<IrConstructorSymbol, IrConstructorSymbol>()
+    protected var enumEntries = hashMapOf<IrEnumEntrySymbol, IrEnumEntrySymbol>()
+    protected var externalPackageFragments = hashMapOf<IrExternalPackageFragmentSymbol, IrExternalPackageFragmentSymbol>()
+    protected var fields = hashMapOf<IrFieldSymbol, IrFieldSymbol>()
+    protected var files = hashMapOf<IrFileSymbol, IrFileSymbol>()
+    protected var functions = hashMapOf<IrSimpleFunctionSymbol, IrSimpleFunctionSymbol>()
+    protected var properties = hashMapOf<IrPropertySymbol, IrPropertySymbol>()
+    protected var returnableBlocks = hashMapOf<IrReturnableBlockSymbol, IrReturnableBlockSymbol>()
+    protected var typeParameters = hashMapOf<IrTypeParameterSymbol, IrTypeParameterSymbol>()
+    protected var valueParameters = hashMapOf<IrValueParameterSymbol, IrValueParameterSymbol>()
+    protected var variables = hashMapOf<IrVariableSymbol, IrVariableSymbol>()
+    protected var localDelegatedProperties = hashMapOf<IrLocalDelegatedPropertySymbol, IrLocalDelegatedPropertySymbol>()
+    protected var typeAliases = hashMapOf<IrTypeAliasSymbol, IrTypeAliasSymbol>()
 
     fun addMappingsFrom(other: DeepCopySymbolRemapper) {
         classes += other.classes
@@ -54,6 +54,22 @@
         typeAliases += other.typeAliases
     }
 
+    fun replaceKeys(remapper: DeepCopySymbolRemapper) {
+        classes = classes.mapKeysTo(hashMapOf()) { remapper.getReferencedClass(it.key) }
+        scripts = scripts.mapKeysTo(hashMapOf()) { remapper.getReferencedScript(it.key) }
+        constructors = constructors.mapKeysTo(hashMapOf()) { remapper.getReferencedConstructor(it.key) }
+        enumEntries = enumEntries.mapKeysTo(hashMapOf()) { remapper.getReferencedEnumEntry(it.key) }
+        fields = fields.mapKeysTo(hashMapOf()) { remapper.getReferencedField(it.key) }
+        functions = functions.mapKeysTo(hashMapOf()) { remapper.getReferencedSimpleFunction(it.key) }
+        properties = properties.mapKeysTo(hashMapOf()) { remapper.getReferencedProperty(it.key) }
+        returnableBlocks = returnableBlocks.mapKeysTo(hashMapOf()) { remapper.getReferencedReturnableBlock(it.key) }
+        typeParameters = typeParameters.mapKeysTo(hashMapOf()) { remapper.getReferencedTypeParameter(it.key) }
+        valueParameters = valueParameters.mapKeysTo(hashMapOf()) { remapper.getReferencedValueParameter(it.key) }
+        variables = variables.mapKeysTo(hashMapOf()) { remapper.getReferencedVariable(it.key) }
+        localDelegatedProperties = localDelegatedProperties.mapKeysTo(hashMapOf()) { remapper.getReferencedLocalDelegatedProperty(it.key) }
+        typeAliases = typeAliases.mapKeysTo(hashMapOf()) { remapper.getReferencedTypeAlias(it.key) }
+    }
+
     override fun visitElement(element: IrElement) {
         element.acceptChildrenVoid(this)
     }
@@ -206,7 +222,7 @@
     override fun getReferencedScript(symbol: IrScriptSymbol): IrScriptSymbol = scripts.getReferenced(symbol)
     override fun getReferencedEnumEntry(symbol: IrEnumEntrySymbol): IrEnumEntrySymbol = enumEntries.getReferenced(symbol)
     override fun getReferencedVariable(symbol: IrVariableSymbol): IrVariableSymbol = variables.getReferenced(symbol)
-    override fun getReferencedValueParameter(symbol: IrValueParameterSymbol): IrValueSymbol = valueParameters.getReferenced(symbol)
+    override fun getReferencedValueParameter(symbol: IrValueParameterSymbol): IrValueParameterSymbol = valueParameters.getReferenced(symbol)
     override fun getReferencedLocalDelegatedProperty(symbol: IrLocalDelegatedPropertySymbol): IrLocalDelegatedPropertySymbol =
         localDelegatedProperties.getReferenced(symbol)
 
@@ -215,10 +231,10 @@
     override fun getReferencedSimpleFunction(symbol: IrSimpleFunctionSymbol): IrSimpleFunctionSymbol = functions.getReferenced(symbol)
     override fun getReferencedProperty(symbol: IrPropertySymbol): IrPropertySymbol = properties.getReferenced(symbol)
 
-    override fun getReferencedReturnableBlock(symbol: IrReturnableBlockSymbol): IrReturnTargetSymbol =
+    override fun getReferencedReturnableBlock(symbol: IrReturnableBlockSymbol): IrReturnableBlockSymbol =
         returnableBlocks.getReferenced(symbol)
 
-    override fun getReferencedTypeParameter(symbol: IrTypeParameterSymbol): IrClassifierSymbol = typeParameters.getReferenced(symbol)
+    override fun getReferencedTypeParameter(symbol: IrTypeParameterSymbol): IrTypeParameterSymbol = typeParameters.getReferenced(symbol)
 
     override fun getReferencedTypeAlias(symbol: IrTypeAliasSymbol): IrTypeAliasSymbol = typeAliases.getReferenced(symbol)
 }
\ No newline at end of file
diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/dumpKotlinLike.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/dumpKotlinLike.kt
index 2a5d612..2021e06 100644
--- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/dumpKotlinLike.kt
+++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/dumpKotlinLike.kt
@@ -209,14 +209,22 @@
         get() = if (!isBound) {
             "/* ERROR: unbound symbol $signature */"
         } else {
-            (owner as? IrDeclaration)?.parentClassOrNull?.name?.toString() ?: "/* ERROR: unexpected parent for $safeName */"
+            try {
+                (owner as? IrDeclaration)?.parentClassOrNull?.name?.toString()
+            } catch (e: UninitializedPropertyAccessException) {
+                null
+            } ?: "/* ERROR: unexpected parent for $safeName */"
         }
 
     private val IrSymbol.safeParentClassOrNull
         get() = if (!isBound) {
             null
         } else {
-            (owner as? IrDeclaration)?.parentClassOrNull
+            try {
+                (owner as? IrDeclaration)?.parentClassOrNull
+            } catch (e: UninitializedPropertyAccessException) {
+                null
+            }
         }
 
 
diff --git a/compiler/testData/codegen/boxInline/anonymousObject/localClassExtraction.kt b/compiler/testData/codegen/boxInline/anonymousObject/localClassExtraction.kt
new file mode 100644
index 0000000..3183b64
--- /dev/null
+++ b/compiler/testData/codegen/boxInline/anonymousObject/localClassExtraction.kt
@@ -0,0 +1,55 @@
+// MODULE: lib
+// FILE: lib.kt
+
+inline fun publicInlineMethod(): Any = object {}
+
+inline fun publicInlineMethodWithCrossinline(crossinline f: () -> Unit): Any = object {
+    fun run() = f()
+}
+
+inline fun publicInlineMethod2() = publicInlineMethodWithCrossinline {}
+
+// FILE: lib-test.kt
+fun libtest1(): String = publicInlineMethod()::class.toString()
+fun libtest2(): String = publicInlineMethod()::class.simpleName!!
+inline fun libtest3(): String = publicInlineMethod()::class.simpleName!!
+fun libtest4(): String = libtest3()
+fun libtest5(): String = publicInlineMethod2()::class.simpleName!!
+fun libtest6(): String = publicInlineMethod2()::class.simpleName!!
+inline fun libtest7(): String = publicInlineMethod2()::class.simpleName!!
+
+fun libtest8(): String = libtest7()
+
+// MODULE: main(lib)
+// FILE: main-test.kt
+fun maintest1(): String = publicInlineMethod()::class.simpleName!!
+fun maintest2(): String = publicInlineMethod()::class.simpleName!!
+inline fun maintest3(): String = publicInlineMethod()::class.simpleName!!
+fun maintest4(): String = maintest3()
+fun maintest5(): String = publicInlineMethod2()::class.simpleName!!
+fun maintest6(): String = publicInlineMethod2()::class.simpleName!!
+inline fun maintest7(): String = publicInlineMethod2()::class.simpleName!!
+fun maintest8(): String = maintest7()
+
+// FILE: main.kt
+fun assertEquals(expected: Any, actual: Any) {
+    if (expected != actual) throw AssertionError("$expected expected, got $actual")
+}
+
+fun box() {
+    assertEquals("", libtest1())
+    assertEquals("", libtest2())
+    assertEquals("", libtest3())
+    assertEquals("", libtest4())
+    assertEquals("", libtest5())
+    assertEquals("", libtest6())
+    assertEquals("", libtest7())
+
+    assertEquals("", maintest1())
+    assertEquals("", maintest2())
+    assertEquals("", maintest3())
+    assertEquals("", maintest4())
+    assertEquals("", maintest5())
+    assertEquals("", maintest6())
+    assertEquals("", maintest7())
+}
\ No newline at end of file
diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/JvmAbiConsistencyTestRestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/JvmAbiConsistencyTestRestGenerated.java
index 88d2f83..b3a860f 100644
--- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/JvmAbiConsistencyTestRestGenerated.java
+++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/JvmAbiConsistencyTestRestGenerated.java
@@ -468,6 +468,12 @@
       }
 
       @Test
+      @TestMetadata("localClassExtraction.kt")
+      public void testLocalClassExtraction() {
+        runTest("compiler/testData/codegen/boxInline/anonymousObject/localClassExtraction.kt");
+      }
+
+      @Test
       @TestMetadata("objectInLambdaCapturesAnotherObject.kt")
       public void testObjectInLambdaCapturesAnotherObject() {
         runTest("compiler/testData/codegen/boxInline/anonymousObject/objectInLambdaCapturesAnotherObject.kt");
diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxInlineCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxInlineCodegenTestGenerated.java
index 49b1708..0b5d2f9 100644
--- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxInlineCodegenTestGenerated.java
+++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxInlineCodegenTestGenerated.java
@@ -465,6 +465,12 @@
     }
 
     @Test
+    @TestMetadata("localClassExtraction.kt")
+    public void testLocalClassExtraction() {
+      runTest("compiler/testData/codegen/boxInline/anonymousObject/localClassExtraction.kt");
+    }
+
+    @Test
     @TestMetadata("objectInLambdaCapturesAnotherObject.kt")
     public void testObjectInLambdaCapturesAnotherObject() {
       runTest("compiler/testData/codegen/boxInline/anonymousObject/objectInLambdaCapturesAnotherObject.kt");
diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java
index 26208cd..d79428e 100644
--- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java
+++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java
@@ -465,6 +465,12 @@
     }
 
     @Test
+    @TestMetadata("localClassExtraction.kt")
+    public void testLocalClassExtraction() {
+      runTest("compiler/testData/codegen/boxInline/anonymousObject/localClassExtraction.kt");
+    }
+
+    @Test
     @TestMetadata("objectInLambdaCapturesAnotherObject.kt")
     public void testObjectInLambdaCapturesAnotherObject() {
       runTest("compiler/testData/codegen/boxInline/anonymousObject/objectInLambdaCapturesAnotherObject.kt");
diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxInlineCodegenWithBytecodeInlinerTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxInlineCodegenWithBytecodeInlinerTestGenerated.java
index 419b2c3..dc926ad 100644
--- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxInlineCodegenWithBytecodeInlinerTestGenerated.java
+++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxInlineCodegenWithBytecodeInlinerTestGenerated.java
@@ -465,6 +465,12 @@
     }
 
     @Test
+    @TestMetadata("localClassExtraction.kt")
+    public void testLocalClassExtraction() {
+      runTest("compiler/testData/codegen/boxInline/anonymousObject/localClassExtraction.kt");
+    }
+
+    @Test
     @TestMetadata("objectInLambdaCapturesAnotherObject.kt")
     public void testObjectInLambdaCapturesAnotherObject() {
       runTest("compiler/testData/codegen/boxInline/anonymousObject/objectInLambdaCapturesAnotherObject.kt");
diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxInlineCodegenWithIrInlinerTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxInlineCodegenWithIrInlinerTestGenerated.java
index f8e7e39..1b2b136 100644
--- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxInlineCodegenWithIrInlinerTestGenerated.java
+++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxInlineCodegenWithIrInlinerTestGenerated.java
@@ -465,6 +465,12 @@
     }
 
     @Test
+    @TestMetadata("localClassExtraction.kt")
+    public void testLocalClassExtraction() {
+      runTest("compiler/testData/codegen/boxInline/anonymousObject/localClassExtraction.kt");
+    }
+
+    @Test
     @TestMetadata("objectInLambdaCapturesAnotherObject.kt")
     public void testObjectInLambdaCapturesAnotherObject() {
       runTest("compiler/testData/codegen/boxInline/anonymousObject/objectInLambdaCapturesAnotherObject.kt");
diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrCompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrCompileKotlinAgainstInlineKotlinTestGenerated.java
index 03ebd5b..8ab5355 100644
--- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrCompileKotlinAgainstInlineKotlinTestGenerated.java
+++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrCompileKotlinAgainstInlineKotlinTestGenerated.java
@@ -465,6 +465,12 @@
     }
 
     @Test
+    @TestMetadata("localClassExtraction.kt")
+    public void testLocalClassExtraction() {
+      runTest("compiler/testData/codegen/boxInline/anonymousObject/localClassExtraction.kt");
+    }
+
+    @Test
     @TestMetadata("objectInLambdaCapturesAnotherObject.kt")
     public void testObjectInLambdaCapturesAnotherObject() {
       runTest("compiler/testData/codegen/boxInline/anonymousObject/objectInLambdaCapturesAnotherObject.kt");
diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrSerializeCompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrSerializeCompileKotlinAgainstInlineKotlinTestGenerated.java
index 226aefa..74da2d8 100644
--- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrSerializeCompileKotlinAgainstInlineKotlinTestGenerated.java
+++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrSerializeCompileKotlinAgainstInlineKotlinTestGenerated.java
@@ -465,6 +465,12 @@
     }
 
     @Test
+    @TestMetadata("localClassExtraction.kt")
+    public void testLocalClassExtraction() {
+      runTest("compiler/testData/codegen/boxInline/anonymousObject/localClassExtraction.kt");
+    }
+
+    @Test
     @TestMetadata("objectInLambdaCapturesAnotherObject.kt")
     public void testObjectInLambdaCapturesAnotherObject() {
       runTest("compiler/testData/codegen/boxInline/anonymousObject/objectInLambdaCapturesAnotherObject.kt");
diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/JvmIrAgainstOldBoxInlineTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/JvmIrAgainstOldBoxInlineTestGenerated.java
index 800f780..1b21911 100644
--- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/JvmIrAgainstOldBoxInlineTestGenerated.java
+++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/JvmIrAgainstOldBoxInlineTestGenerated.java
@@ -465,6 +465,12 @@
     }
 
     @Test
+    @TestMetadata("localClassExtraction.kt")
+    public void testLocalClassExtraction() {
+      runTest("compiler/testData/codegen/boxInline/anonymousObject/localClassExtraction.kt");
+    }
+
+    @Test
     @TestMetadata("objectInLambdaCapturesAnotherObject.kt")
     public void testObjectInLambdaCapturesAnotherObject() {
       runTest("compiler/testData/codegen/boxInline/anonymousObject/objectInLambdaCapturesAnotherObject.kt");
diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/JvmOldAgainstIrBoxInlineTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/JvmOldAgainstIrBoxInlineTestGenerated.java
index 6c31d66..1514792 100644
--- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/JvmOldAgainstIrBoxInlineTestGenerated.java
+++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/JvmOldAgainstIrBoxInlineTestGenerated.java
@@ -465,6 +465,12 @@
     }
 
     @Test
+    @TestMetadata("localClassExtraction.kt")
+    public void testLocalClassExtraction() {
+      runTest("compiler/testData/codegen/boxInline/anonymousObject/localClassExtraction.kt");
+    }
+
+    @Test
     @TestMetadata("objectInLambdaCapturesAnotherObject.kt")
     public void testObjectInLambdaCapturesAnotherObject() {
       runTest("compiler/testData/codegen/boxInline/anonymousObject/objectInLambdaCapturesAnotherObject.kt");
diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/inlineScopes/FirBlackBoxInlineCodegenWithBytecodeInlinerTestWithInlineScopesGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/inlineScopes/FirBlackBoxInlineCodegenWithBytecodeInlinerTestWithInlineScopesGenerated.java
index 112258d..9b2312e 100644
--- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/inlineScopes/FirBlackBoxInlineCodegenWithBytecodeInlinerTestWithInlineScopesGenerated.java
+++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/inlineScopes/FirBlackBoxInlineCodegenWithBytecodeInlinerTestWithInlineScopesGenerated.java
@@ -465,6 +465,12 @@
     }
 
     @Test
+    @TestMetadata("localClassExtraction.kt")
+    public void testLocalClassExtraction() {
+      runTest("compiler/testData/codegen/boxInline/anonymousObject/localClassExtraction.kt");
+    }
+
+    @Test
     @TestMetadata("objectInLambdaCapturesAnotherObject.kt")
     public void testObjectInLambdaCapturesAnotherObject() {
       runTest("compiler/testData/codegen/boxInline/anonymousObject/objectInLambdaCapturesAnotherObject.kt");
diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/inlineScopes/FirBlackBoxInlineCodegenWithIrInlinerTestWithInlineScopesGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/inlineScopes/FirBlackBoxInlineCodegenWithIrInlinerTestWithInlineScopesGenerated.java
index b6edb91..b8125d8 100644
--- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/inlineScopes/FirBlackBoxInlineCodegenWithIrInlinerTestWithInlineScopesGenerated.java
+++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/inlineScopes/FirBlackBoxInlineCodegenWithIrInlinerTestWithInlineScopesGenerated.java
@@ -465,6 +465,12 @@
     }
 
     @Test
+    @TestMetadata("localClassExtraction.kt")
+    public void testLocalClassExtraction() {
+      runTest("compiler/testData/codegen/boxInline/anonymousObject/localClassExtraction.kt");
+    }
+
+    @Test
     @TestMetadata("objectInLambdaCapturesAnotherObject.kt")
     public void testObjectInLambdaCapturesAnotherObject() {
       runTest("compiler/testData/codegen/boxInline/anonymousObject/objectInLambdaCapturesAnotherObject.kt");
diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/inlineScopes/FirSerializeCompileKotlinAgainstInlineKotlinTestWithInlineScopesGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/inlineScopes/FirSerializeCompileKotlinAgainstInlineKotlinTestWithInlineScopesGenerated.java
index 9ac30de..38429f9 100644
--- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/inlineScopes/FirSerializeCompileKotlinAgainstInlineKotlinTestWithInlineScopesGenerated.java
+++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/inlineScopes/FirSerializeCompileKotlinAgainstInlineKotlinTestWithInlineScopesGenerated.java
@@ -465,6 +465,12 @@
     }
 
     @Test
+    @TestMetadata("localClassExtraction.kt")
+    public void testLocalClassExtraction() {
+      runTest("compiler/testData/codegen/boxInline/anonymousObject/localClassExtraction.kt");
+    }
+
+    @Test
     @TestMetadata("objectInLambdaCapturesAnotherObject.kt")
     public void testObjectInLambdaCapturesAnotherObject() {
       runTest("compiler/testData/codegen/boxInline/anonymousObject/objectInLambdaCapturesAnotherObject.kt");
diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenInlineTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenInlineTestGenerated.java
index 68d3071..37c31e0 100644
--- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenInlineTestGenerated.java
+++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenInlineTestGenerated.java
@@ -423,6 +423,12 @@
     }
 
     @Test
+    @TestMetadata("localClassExtraction.kt")
+    public void testLocalClassExtraction() {
+      runTest("compiler/testData/codegen/boxInline/anonymousObject/localClassExtraction.kt");
+    }
+
+    @Test
     @TestMetadata("objectInLambdaCapturesAnotherObject.kt")
     public void testObjectInLambdaCapturesAnotherObject() {
       runTest("compiler/testData/codegen/boxInline/anonymousObject/objectInLambdaCapturesAnotherObject.kt");
diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenInlineTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenInlineTestGenerated.java
index 3a16e8d..5a56ab2 100644
--- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenInlineTestGenerated.java
+++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenInlineTestGenerated.java
@@ -423,6 +423,12 @@
     }
 
     @Test
+    @TestMetadata("localClassExtraction.kt")
+    public void testLocalClassExtraction() {
+      runTest("compiler/testData/codegen/boxInline/anonymousObject/localClassExtraction.kt");
+    }
+
+    @Test
     @TestMetadata("objectInLambdaCapturesAnotherObject.kt")
     public void testObjectInLambdaCapturesAnotherObject() {
       runTest("compiler/testData/codegen/boxInline/anonymousObject/objectInLambdaCapturesAnotherObject.kt");
diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenInlineTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenInlineTestGenerated.java
index e38f267..0392500 100644
--- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenInlineTestGenerated.java
+++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenInlineTestGenerated.java
@@ -423,6 +423,12 @@
     }
 
     @Test
+    @TestMetadata("localClassExtraction.kt")
+    public void testLocalClassExtraction() {
+      runTest("compiler/testData/codegen/boxInline/anonymousObject/localClassExtraction.kt");
+    }
+
+    @Test
     @TestMetadata("objectInLambdaCapturesAnotherObject.kt")
     public void testObjectInLambdaCapturesAnotherObject() {
       runTest("compiler/testData/codegen/boxInline/anonymousObject/objectInLambdaCapturesAnotherObject.kt");
diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenInlineTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenInlineTestGenerated.java
index f8c011c..5e17083 100644
--- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenInlineTestGenerated.java
+++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenInlineTestGenerated.java
@@ -423,6 +423,12 @@
     }
 
     @Test
+    @TestMetadata("localClassExtraction.kt")
+    public void testLocalClassExtraction() {
+      runTest("compiler/testData/codegen/boxInline/anonymousObject/localClassExtraction.kt");
+    }
+
+    @Test
     @TestMetadata("objectInLambdaCapturesAnotherObject.kt")
     public void testObjectInLambdaCapturesAnotherObject() {
       runTest("compiler/testData/codegen/boxInline/anonymousObject/objectInLambdaCapturesAnotherObject.kt");
diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestGenerated.java
index cdaf031..1be295c 100644
--- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestGenerated.java
+++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestGenerated.java
@@ -46926,6 +46926,12 @@
       }
 
       @Test
+      @TestMetadata("localClassExtraction.kt")
+      public void testLocalClassExtraction() {
+        runTest("compiler/testData/codegen/boxInline/anonymousObject/localClassExtraction.kt");
+      }
+
+      @Test
       @TestMetadata("objectInLambdaCapturesAnotherObject.kt")
       public void testObjectInLambdaCapturesAnotherObject() {
         runTest("compiler/testData/codegen/boxInline/anonymousObject/objectInLambdaCapturesAnotherObject.kt");
diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestNoPLGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestNoPLGenerated.java
index 22adf50..16c4188 100644
--- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestNoPLGenerated.java
+++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestNoPLGenerated.java
@@ -48096,6 +48096,12 @@
       }
 
       @Test
+      @TestMetadata("localClassExtraction.kt")
+      public void testLocalClassExtraction() {
+        runTest("compiler/testData/codegen/boxInline/anonymousObject/localClassExtraction.kt");
+      }
+
+      @Test
       @TestMetadata("objectInLambdaCapturesAnotherObject.kt")
       public void testObjectInLambdaCapturesAnotherObject() {
         runTest("compiler/testData/codegen/boxInline/anonymousObject/objectInLambdaCapturesAnotherObject.kt");
diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestGenerated.java
index c789d1e..3e8dd3f 100644
--- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestGenerated.java
+++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestGenerated.java
@@ -45085,6 +45085,12 @@
       }
 
       @Test
+      @TestMetadata("localClassExtraction.kt")
+      public void testLocalClassExtraction() {
+        runTest("compiler/testData/codegen/boxInline/anonymousObject/localClassExtraction.kt");
+      }
+
+      @Test
       @TestMetadata("objectInLambdaCapturesAnotherObject.kt")
       public void testObjectInLambdaCapturesAnotherObject() {
         runTest("compiler/testData/codegen/boxInline/anonymousObject/objectInLambdaCapturesAnotherObject.kt");
diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestNoPLGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestNoPLGenerated.java
index e40048f..5219327 100644
--- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestNoPLGenerated.java
+++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestNoPLGenerated.java
@@ -46242,6 +46242,12 @@
       }
 
       @Test
+      @TestMetadata("localClassExtraction.kt")
+      public void testLocalClassExtraction() {
+        runTest("compiler/testData/codegen/boxInline/anonymousObject/localClassExtraction.kt");
+      }
+
+      @Test
       @TestMetadata("objectInLambdaCapturesAnotherObject.kt")
       public void testObjectInLambdaCapturesAnotherObject() {
         runTest("compiler/testData/codegen/boxInline/anonymousObject/objectInLambdaCapturesAnotherObject.kt");
diff --git a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmJsCodegenBoxInlineTestGenerated.java b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmJsCodegenBoxInlineTestGenerated.java
index 4e65d3e..4fafe52 100644
--- a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmJsCodegenBoxInlineTestGenerated.java
+++ b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmJsCodegenBoxInlineTestGenerated.java
@@ -423,6 +423,12 @@
     }
 
     @Test
+    @TestMetadata("localClassExtraction.kt")
+    public void testLocalClassExtraction() {
+      runTest("compiler/testData/codegen/boxInline/anonymousObject/localClassExtraction.kt");
+    }
+
+    @Test
     @TestMetadata("objectInLambdaCapturesAnotherObject.kt")
     public void testObjectInLambdaCapturesAnotherObject() {
       runTest("compiler/testData/codegen/boxInline/anonymousObject/objectInLambdaCapturesAnotherObject.kt");
diff --git a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxInlineTestGenerated.java b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxInlineTestGenerated.java
index 83ed64d..a72eace 100644
--- a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxInlineTestGenerated.java
+++ b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxInlineTestGenerated.java
@@ -423,6 +423,12 @@
     }
 
     @Test
+    @TestMetadata("localClassExtraction.kt")
+    public void testLocalClassExtraction() {
+      runTest("compiler/testData/codegen/boxInline/anonymousObject/localClassExtraction.kt");
+    }
+
+    @Test
     @TestMetadata("objectInLambdaCapturesAnotherObject.kt")
     public void testObjectInLambdaCapturesAnotherObject() {
       runTest("compiler/testData/codegen/boxInline/anonymousObject/objectInLambdaCapturesAnotherObject.kt");