From 3713d95bb1fc0cc434eeed42a0f0adac52af091b Mon Sep 17 00:00:00 2001 From: Sergej Jaskiewicz Date: Tue, 28 Mar 2023 19:34:10 +0200 Subject: [PATCH] [klib] Don't deserialize the list of sealed subclasses from klibs tl;dr the current design of klibs does not allow to properly deserialize the list of sealed subclasses in a sound way. It is possible that a subclass of a sealed class is declared in a different file, AND is private in that file. A more detailed explanation: Right now we don't serialize file signatures at all. However, a private declaration's signature must necessarily include the file signature. How do we serialize a private declaration's signature into a klib and deserialize it later? **Serialization** is simple: we just serialize the file signature as an empty protobuf message. When we are **deserializing** a private declaration, we look at the file that is being deserialized right now, and construct the file signature based on that. This logic, however, doesn't always work. An example is KT-54028. Basically, if we have a sealed interface with a private implementor declared in a different file, this breaks: 1. We are deserializing the sealed interface. The deserializer knows that we are now in the file in which the sealed interface is declared. 2. As part of deserializing the interface, we deserialize its sealed subclasses. 3. Naturally, we come to deserializing the private implementor that is declared in another file, but the deserializer still thinks that we are in the file in which the interface is declared. A wrong signature is created, which leads to linkage failure. We *could* fix this by properly serializing the file signature, i.e. instead of an empty protobuf message we could write the file path and its package to the klib. However, there a problems with this approach: - The current design of signatures allows a situation where two different files can have the same relative path (for example, with the help of the `-Xklib-relative-path-base` compiler flag) *and* the same package, which would introduce ambiguity during linkage. - Most importantly, this appoach won't work well with incremental compilation of klibs. Currently we rely on the assumption that all cross-file references are handled with public signatures, and private signatures are only used inside a single file. This allows to move declarations across files without recompiling it's use sites. It has been decided to apply the following hacky solution: we just don't deserialize the list of sealed subclasses from klibs. The list of sealed subclasses is not used in lowerings, so it should be safe. #KT-54028 Fixed --- ...LightTreeBlackBoxCodegenTestGenerated.java | 12 ++++++ .../FirPsiBlackBoxCodegenTestGenerated.java | 12 ++++++ .../kotlin/ir/declarations/IrClass.kt | 8 ++++ .../jetbrains/kotlin/ir/generator/IrTree.kt | 10 ++++- .../IrDeclarationDeserializer.kt | 3 +- .../testData/codegen/box/sealed/kt54028.kt | 27 ++++++++++++++ .../codegen/box/sealed/kt54028_cursed.kt | 37 +++++++++++++++++++ .../ir/irText/classes/sealedClasses.kt | 3 +- .../multiplatform/expectedSealedClass.kt | 1 + .../ir/irText/firProblems/ArrayMap.kt | 1 + .../codegen/BlackBoxCodegenTestGenerated.java | 12 ++++++ .../IrBlackBoxCodegenTestGenerated.java | 12 ++++++ ...kBoxCodegenWithIrInlinerTestGenerated.java | 12 ++++++ .../LightAnalysisModeTestGenerated.java | 10 +++++ .../js/test/JsCodegenBoxTestGenerated.java | 12 ++++++ .../fir/FirJsCodegenBoxTestGenerated.java | 12 ++++++ .../test/ir/IrJsCodegenBoxTestGenerated.java | 12 ++++++ .../ir/IrJsES6CodegenBoxTestGenerated.java | 12 ++++++ .../FirNativeCodegenBoxTestGenerated.java | 12 ++++++ .../FirNativeCodegenBoxTestNoPLGenerated.java | 12 ++++++ .../NativeCodegenBoxTestGenerated.java | 12 ++++++ .../NativeCodegenBoxTestNoPLGenerated.java | 12 ++++++ .../test/IrCodegenBoxWasmTestGenerated.java | 10 +++++ 23 files changed, 263 insertions(+), 3 deletions(-) create mode 100644 compiler/testData/codegen/box/sealed/kt54028.kt create mode 100644 compiler/testData/codegen/box/sealed/kt54028_cursed.kt 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 9282293c39a..97cbf336664 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 @@ -48799,6 +48799,18 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr runTest("compiler/testData/codegen/box/sealed/kt49752.kt"); } + @Test + @TestMetadata("kt54028.kt") + public void testKt54028() throws Exception { + runTest("compiler/testData/codegen/box/sealed/kt54028.kt"); + } + + @Test + @TestMetadata("kt54028_cursed.kt") + public void testKt54028_cursed() throws Exception { + runTest("compiler/testData/codegen/box/sealed/kt54028_cursed.kt"); + } + @Test @TestMetadata("multipleFiles_enabled.kt") public void testMultipleFiles_enabled() throws Exception { 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 c701dfc5dbf..ef4520dab5f 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 @@ -48799,6 +48799,18 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo runTest("compiler/testData/codegen/box/sealed/kt49752.kt"); } + @Test + @TestMetadata("kt54028.kt") + public void testKt54028() throws Exception { + runTest("compiler/testData/codegen/box/sealed/kt54028.kt"); + } + + @Test + @TestMetadata("kt54028_cursed.kt") + public void testKt54028_cursed() throws Exception { + runTest("compiler/testData/codegen/box/sealed/kt54028_cursed.kt"); + } + @Test @TestMetadata("multipleFiles_enabled.kt") public void testMultipleFiles_enabled() throws Exception { diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/IrClass.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/IrClass.kt index c124e7f08a2..82314ae4fd5 100644 --- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/IrClass.kt +++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/IrClass.kt @@ -59,6 +59,14 @@ abstract class IrClass : IrDeclarationBase(), IrPossiblyExternalDeclaration, abstract var valueClassRepresentation: ValueClassRepresentation? + /** + * If this is a sealed class or interface, this list contains symbols of all its immediate + * subclasses. + * Otherwise, this is an empty list. + * + * NOTE: If this [IrClass] was deserialized from a klib, this list will always be empty! + * See [KT-54028](https://youtrack.jetbrains.com/issue/KT-54028). + */ abstract var sealedSubclasses: List override fun accept(visitor: IrElementVisitor, data: D): R = diff --git a/compiler/ir/ir.tree/tree-generator/src/org/jetbrains/kotlin/ir/generator/IrTree.kt b/compiler/ir/ir.tree/tree-generator/src/org/jetbrains/kotlin/ir/generator/IrTree.kt index a2a9d33967d..b9956544875 100644 --- a/compiler/ir/ir.tree/tree-generator/src/org/jetbrains/kotlin/ir/generator/IrTree.kt +++ b/compiler/ir/ir.tree/tree-generator/src/org/jetbrains/kotlin/ir/generator/IrTree.kt @@ -199,7 +199,15 @@ object IrTree : AbstractTreeBuilder() { type>().withArgs(type(Packages.types, "IrSimpleType")), nullable = true, ) - +listField("sealedSubclasses", classSymbolType, mutability = Var) + +listField("sealedSubclasses", classSymbolType, mutability = Var) { + kdoc = """ + If this is a sealed class or interface, this list contains symbols of all its immediate subclasses. + Otherwise, this is an empty list. + + NOTE: If this [${elementName2typeName(this@element.name)}] was deserialized from a klib, this list will always be empty! + See [KT-54028](https://youtrack.jetbrains.com/issue/KT-54028). + """.trimIndent() + } } val attributeContainer: ElementConfig by element(Declaration) { kDoc = """ diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/IrDeclarationDeserializer.kt b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/IrDeclarationDeserializer.kt index bc7fed8628c..4223ca1103d 100644 --- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/IrDeclarationDeserializer.kt +++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/IrDeclarationDeserializer.kt @@ -389,7 +389,8 @@ class IrDeclarationDeserializer( else -> computeMissingInlineClassRepresentationForCompatibility(this) } - sealedSubclasses = proto.sealedSubclassList.map { deserializeIrSymbol(it).checkSymbolType(CLASS_SYMBOL) } + // It has been desided not to deserialize the list of sealed subclasses because of KT-54028 + // sealedSubclasses = proto.sealedSubclassList.map { deserializeIrSymbol(it).checkSymbolType(CLASS_SYMBOL) } fakeOverrideBuilder.enqueueClass(this, signature, compatibilityMode) } diff --git a/compiler/testData/codegen/box/sealed/kt54028.kt b/compiler/testData/codegen/box/sealed/kt54028.kt new file mode 100644 index 00000000000..a17fe029142 --- /dev/null +++ b/compiler/testData/codegen/box/sealed/kt54028.kt @@ -0,0 +1,27 @@ +// KT-54028 + +// MODULE: lib +// FILE: file1.kt + +sealed interface LazyGridLayoutInfo { + fun ok(): String +} + +// FILE: file2.kt + +class LazyGridState { + val layoutInfo: LazyGridLayoutInfo + get() = EmptyLazyGridLayoutInfo +} + +private object EmptyLazyGridLayoutInfo : LazyGridLayoutInfo { + override fun ok() = "OK" +} + +// MODULE: main(lib) +// FILE: main.kt + +fun box(): String { + return LazyGridState().layoutInfo.ok() +} + diff --git a/compiler/testData/codegen/box/sealed/kt54028_cursed.kt b/compiler/testData/codegen/box/sealed/kt54028_cursed.kt new file mode 100644 index 00000000000..55cfa57591f --- /dev/null +++ b/compiler/testData/codegen/box/sealed/kt54028_cursed.kt @@ -0,0 +1,37 @@ +// ALLOW_FILES_WITH_SAME_NAMES + +// The test infrastructure for Kotlin/Native doesn't allow files with same names. +// IGNORE_BACKEND: NATIVE + +// IGNORE_BACKEND: JS +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND_K2: JS_IR + +// Test that if we have two different files with the same name in the same package, KT-54028 doesn't reproduce. + +// MODULE: lib + +// FILE: cursed.kt + +sealed interface LazyGridLayoutInfo { + fun ok(): String +} + +// FILE: cursed.kt + +class LazyGridState { + val layoutInfo: LazyGridLayoutInfo + get() = EmptyLazyGridLayoutInfo +} + +private object EmptyLazyGridLayoutInfo : LazyGridLayoutInfo { + override fun ok() = "OK" +} + +// MODULE: main(lib) +// FILE: main.kt + +fun box(): String { + return LazyGridState().layoutInfo.ok() +} + diff --git a/compiler/testData/ir/irText/classes/sealedClasses.kt b/compiler/testData/ir/irText/classes/sealedClasses.kt index 1b59fb65501..2444ce36943 100644 --- a/compiler/testData/ir/irText/classes/sealedClasses.kt +++ b/compiler/testData/ir/irText/classes/sealedClasses.kt @@ -1,6 +1,7 @@ // FIR_IDENTICAL +// SKIP_KLIB_TEST sealed class Expr { class Const(val number: Double) : Expr() class Sum(val e1: Expr, val e2: Expr) : Expr() object NotANumber : Expr() -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/declarations/multiplatform/expectedSealedClass.kt b/compiler/testData/ir/irText/declarations/multiplatform/expectedSealedClass.kt index 4091adc2440..8cc0fd1c61d 100644 --- a/compiler/testData/ir/irText/declarations/multiplatform/expectedSealedClass.kt +++ b/compiler/testData/ir/irText/declarations/multiplatform/expectedSealedClass.kt @@ -2,6 +2,7 @@ // IGNORE_BACKEND_K2: JS_IR // IGNORE_BACKEND_K2: JS_IR_ES6 // !LANGUAGE: +MultiPlatformProjects +// SKIP_KLIB_TEST expect sealed class Ops() expect class Add() : Ops diff --git a/compiler/testData/ir/irText/firProblems/ArrayMap.kt b/compiler/testData/ir/irText/firProblems/ArrayMap.kt index 7ca2a727fb7..55955fb3e10 100644 --- a/compiler/testData/ir/irText/firProblems/ArrayMap.kt +++ b/compiler/testData/ir/irText/firProblems/ArrayMap.kt @@ -1,4 +1,5 @@ // WITH_STDLIB +// SKIP_KLIB_TEST // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index 02eb1d064ae..51bf36f7960 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -46309,6 +46309,18 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/sealed/kt49752.kt"); } + @Test + @TestMetadata("kt54028.kt") + public void testKt54028() throws Exception { + runTest("compiler/testData/codegen/box/sealed/kt54028.kt"); + } + + @Test + @TestMetadata("kt54028_cursed.kt") + public void testKt54028_cursed() throws Exception { + runTest("compiler/testData/codegen/box/sealed/kt54028_cursed.kt"); + } + @Test @TestMetadata("multipleFiles_enabled.kt") public void testMultipleFiles_enabled() throws Exception { 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 5f4d9088d13..401a3d8c709 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 @@ -48799,6 +48799,18 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/sealed/kt49752.kt"); } + @Test + @TestMetadata("kt54028.kt") + public void testKt54028() throws Exception { + runTest("compiler/testData/codegen/box/sealed/kt54028.kt"); + } + + @Test + @TestMetadata("kt54028_cursed.kt") + public void testKt54028_cursed() throws Exception { + runTest("compiler/testData/codegen/box/sealed/kt54028_cursed.kt"); + } + @Test @TestMetadata("multipleFiles_enabled.kt") public void testMultipleFiles_enabled() throws Exception { 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 47f22fbd684..522d22e6ea9 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 @@ -48799,6 +48799,18 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack runTest("compiler/testData/codegen/box/sealed/kt49752.kt"); } + @Test + @TestMetadata("kt54028.kt") + public void testKt54028() throws Exception { + runTest("compiler/testData/codegen/box/sealed/kt54028.kt"); + } + + @Test + @TestMetadata("kt54028_cursed.kt") + public void testKt54028_cursed() throws Exception { + runTest("compiler/testData/codegen/box/sealed/kt54028_cursed.kt"); + } + @Test @TestMetadata("multipleFiles_enabled.kt") public void testMultipleFiles_enabled() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 2d6e5d0ea18..a00a5a3041f 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -37475,6 +37475,16 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/sealed/kt49752.kt"); } + @TestMetadata("kt54028.kt") + public void testKt54028() throws Exception { + runTest("compiler/testData/codegen/box/sealed/kt54028.kt"); + } + + @TestMetadata("kt54028_cursed.kt") + public void testKt54028_cursed() throws Exception { + runTest("compiler/testData/codegen/box/sealed/kt54028_cursed.kt"); + } + @TestMetadata("multipleFiles_enabled.kt") public void testMultipleFiles_enabled() throws Exception { runTest("compiler/testData/codegen/box/sealed/multipleFiles_enabled.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java index c28c4507fda..2046d0799ad 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java @@ -34365,6 +34365,18 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/sealed/kt49752.kt"); } + @Test + @TestMetadata("kt54028.kt") + public void testKt54028() throws Exception { + runTest("compiler/testData/codegen/box/sealed/kt54028.kt"); + } + + @Test + @TestMetadata("kt54028_cursed.kt") + public void testKt54028_cursed() throws Exception { + runTest("compiler/testData/codegen/box/sealed/kt54028_cursed.kt"); + } + @Test @TestMetadata("multipleFiles_enabled.kt") public void testMultipleFiles_enabled() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java index ee6f583a93d..eac8555b09b 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java @@ -34677,6 +34677,18 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest { runTest("compiler/testData/codegen/box/sealed/kt49752.kt"); } + @Test + @TestMetadata("kt54028.kt") + public void testKt54028() throws Exception { + runTest("compiler/testData/codegen/box/sealed/kt54028.kt"); + } + + @Test + @TestMetadata("kt54028_cursed.kt") + public void testKt54028_cursed() throws Exception { + runTest("compiler/testData/codegen/box/sealed/kt54028_cursed.kt"); + } + @Test @TestMetadata("multipleFiles_enabled.kt") public void testMultipleFiles_enabled() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java index 78eea0a669c..dc4f25661e2 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java @@ -34677,6 +34677,18 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/sealed/kt49752.kt"); } + @Test + @TestMetadata("kt54028.kt") + public void testKt54028() throws Exception { + runTest("compiler/testData/codegen/box/sealed/kt54028.kt"); + } + + @Test + @TestMetadata("kt54028_cursed.kt") + public void testKt54028_cursed() throws Exception { + runTest("compiler/testData/codegen/box/sealed/kt54028_cursed.kt"); + } + @Test @TestMetadata("multipleFiles_enabled.kt") public void testMultipleFiles_enabled() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java index d613da2d1fe..5370fb3b644 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java @@ -34677,6 +34677,18 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes runTest("compiler/testData/codegen/box/sealed/kt49752.kt"); } + @Test + @TestMetadata("kt54028.kt") + public void testKt54028() throws Exception { + runTest("compiler/testData/codegen/box/sealed/kt54028.kt"); + } + + @Test + @TestMetadata("kt54028_cursed.kt") + public void testKt54028_cursed() throws Exception { + runTest("compiler/testData/codegen/box/sealed/kt54028_cursed.kt"); + } + @Test @TestMetadata("multipleFiles_enabled.kt") public void testMultipleFiles_enabled() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestGenerated.java index 73ff00f712b..2a2163540d6 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestGenerated.java @@ -38735,6 +38735,18 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe runTest("compiler/testData/codegen/box/sealed/kt49752.kt"); } + @Test + @TestMetadata("kt54028.kt") + public void testKt54028() throws Exception { + runTest("compiler/testData/codegen/box/sealed/kt54028.kt"); + } + + @Test + @TestMetadata("kt54028_cursed.kt") + public void testKt54028_cursed() throws Exception { + runTest("compiler/testData/codegen/box/sealed/kt54028_cursed.kt"); + } + @Test @TestMetadata("multipleFiles_enabled.kt") public void testMultipleFiles_enabled() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestNoPLGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestNoPLGenerated.java index 9a9a4f82486..9e63fc4e2f8 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestNoPLGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestNoPLGenerated.java @@ -39693,6 +39693,18 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB runTest("compiler/testData/codegen/box/sealed/kt49752.kt"); } + @Test + @TestMetadata("kt54028.kt") + public void testKt54028() throws Exception { + runTest("compiler/testData/codegen/box/sealed/kt54028.kt"); + } + + @Test + @TestMetadata("kt54028_cursed.kt") + public void testKt54028_cursed() throws Exception { + runTest("compiler/testData/codegen/box/sealed/kt54028_cursed.kt"); + } + @Test @TestMetadata("multipleFiles_enabled.kt") public void testMultipleFiles_enabled() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java index 2c4cae3d591..527565253d9 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java @@ -38256,6 +38256,18 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest runTest("compiler/testData/codegen/box/sealed/kt49752.kt"); } + @Test + @TestMetadata("kt54028.kt") + public void testKt54028() throws Exception { + runTest("compiler/testData/codegen/box/sealed/kt54028.kt"); + } + + @Test + @TestMetadata("kt54028_cursed.kt") + public void testKt54028_cursed() throws Exception { + runTest("compiler/testData/codegen/box/sealed/kt54028_cursed.kt"); + } + @Test @TestMetadata("multipleFiles_enabled.kt") public void testMultipleFiles_enabled() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestNoPLGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestNoPLGenerated.java index d835c8fb6a0..365d32e52cc 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestNoPLGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestNoPLGenerated.java @@ -39214,6 +39214,18 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT runTest("compiler/testData/codegen/box/sealed/kt49752.kt"); } + @Test + @TestMetadata("kt54028.kt") + public void testKt54028() throws Exception { + runTest("compiler/testData/codegen/box/sealed/kt54028.kt"); + } + + @Test + @TestMetadata("kt54028_cursed.kt") + public void testKt54028_cursed() throws Exception { + runTest("compiler/testData/codegen/box/sealed/kt54028_cursed.kt"); + } + @Test @TestMetadata("multipleFiles_enabled.kt") public void testMultipleFiles_enabled() throws Exception { diff --git a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/IrCodegenBoxWasmTestGenerated.java b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/IrCodegenBoxWasmTestGenerated.java index a0b2de3f5da..319a7b68cfa 100644 --- a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/IrCodegenBoxWasmTestGenerated.java +++ b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/IrCodegenBoxWasmTestGenerated.java @@ -30990,6 +30990,16 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/sealed/kt49752.kt"); } + @TestMetadata("kt54028.kt") + public void testKt54028() throws Exception { + runTest("compiler/testData/codegen/box/sealed/kt54028.kt"); + } + + @TestMetadata("kt54028_cursed.kt") + public void testKt54028_cursed() throws Exception { + runTest("compiler/testData/codegen/box/sealed/kt54028_cursed.kt"); + } + @TestMetadata("multipleFiles_enabled.kt") public void testMultipleFiles_enabled() throws Exception { runTest("compiler/testData/codegen/box/sealed/multipleFiles_enabled.kt");