diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index 450048ebc7d..5a0edd0160e 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -7142,6 +7142,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT public void testInlineFunctionCompanionPropertyAccess() throws Exception { runTest("compiler/testData/codegen/box/companion/inlineFunctionCompanionPropertyAccess.kt"); } + + @Test + @TestMetadata("kt54645.kt") + public void testKt54645() throws Exception { + runTest("compiler/testData/codegen/box/companion/kt54645.kt"); + } } @Nested diff --git a/compiler/testData/codegen/box/companion/kt54645.kt b/compiler/testData/codegen/box/companion/kt54645.kt new file mode 100644 index 00000000000..1bcec7f80c7 --- /dev/null +++ b/compiler/testData/codegen/box/companion/kt54645.kt @@ -0,0 +1,22 @@ +// TARGET_BACKEND: JVM_IR +// IGNORE_BACKEND_FIR: JVM_IR +// ISSUE: KT-54645 + +abstract class Base { + open class Nested +} + +sealed class Derived : Base() { + open class Nested +} + +class Impl() : Derived() { + companion object : Nested() +} + +fun takeDerivedNested(x: Derived.Nested) {} + +fun box(): String { + takeDerivedNested(Impl) + return "OK" +} 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 401d8ea98db..1f74efc7ede 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 @@ -7142,6 +7142,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes public void testInlineFunctionCompanionPropertyAccess() throws Exception { runTest("compiler/testData/codegen/box/companion/inlineFunctionCompanionPropertyAccess.kt"); } + + @Test + @TestMetadata("kt54645.kt") + public void testKt54645() throws Exception { + runTest("compiler/testData/codegen/box/companion/kt54645.kt"); + } } @Nested