From d972b78627a580fa31eee774be1767644e68faf0 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Fri, 16 Jun 2023 16:22:20 +0300 Subject: [PATCH] [FIR] Allow actualization of expect classes by classes with wider visibility ^KT-59355 Fixed --- ...DiagnosticsWithLightTreeTestGenerated.java | 6 +++ ...endMPPDiagnosticsWithPsiTestGenerated.java | 6 +++ ...LightTreeBlackBoxCodegenTestGenerated.java | 6 +++ .../FirPsiBlackBoxCodegenTestGenerated.java | 6 +++ .../mpp/FirExpectActualMatchingContext.kt | 3 ++ .../IrExpectActualMatchingContext.kt | 3 ++ ...bstractExpectActualCompatibilityChecker.kt | 21 ++++++-- .../calls/mpp/ExpectActualMatchingContext.kt | 11 +++++ .../widerVisibilityInActualClassifier.kt | 49 +++++++++++++++++++ .../widerVisibilityInActualClassifier.fir.kt | 34 +++++++++++++ .../widerVisibilityInActualClassifier.kt | 34 +++++++++++++ .../test/runners/DiagnosticTestGenerated.java | 6 +++ .../codegen/BlackBoxCodegenTestGenerated.java | 6 +++ .../IrBlackBoxCodegenTestGenerated.java | 6 +++ ...kBoxCodegenWithIrInlinerTestGenerated.java | 6 +++ .../LightAnalysisModeTestGenerated.java | 5 ++ .../js/test/JsCodegenBoxTestGenerated.java | 6 +++ .../fir/FirJsCodegenBoxTestGenerated.java | 6 +++ .../test/ir/IrJsCodegenBoxTestGenerated.java | 6 +++ .../ir/IrJsES6CodegenBoxTestGenerated.java | 6 +++ .../FirNativeCodegenBoxTestGenerated.java | 6 +++ .../FirNativeCodegenBoxTestNoPLGenerated.java | 6 +++ .../NativeCodegenBoxTestGenerated.java | 6 +++ .../NativeCodegenBoxTestNoPLGenerated.java | 6 +++ .../test/IrCodegenBoxWasmTestGenerated.java | 5 ++ 25 files changed, 257 insertions(+), 4 deletions(-) create mode 100644 compiler/testData/codegen/box/multiplatform/k2/basic/widerVisibilityInActualClassifier.kt create mode 100644 compiler/testData/diagnostics/tests/multiplatform/widerVisibilityInActualClassifier.fir.kt create mode 100644 compiler/testData/diagnostics/tests/multiplatform/widerVisibilityInActualClassifier.kt diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated.java index 1d83c1b007b..07b548729b6 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated.java @@ -175,6 +175,12 @@ public class FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated extends Abst runTest("compiler/testData/diagnostics/tests/multiplatform/varSetterVisibility.kt"); } + @Test + @TestMetadata("widerVisibilityInActualClassifier.kt") + public void testWiderVisibilityInActualClassifier() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/widerVisibilityInActualClassifier.kt"); + } + @Nested @TestMetadata("compiler/testData/diagnostics/tests/multiplatform/defaultArguments") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithPsiTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithPsiTestGenerated.java index d0e55b71733..7e3ff29c19d 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithPsiTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithPsiTestGenerated.java @@ -175,6 +175,12 @@ public class FirOldFrontendMPPDiagnosticsWithPsiTestGenerated extends AbstractFi runTest("compiler/testData/diagnostics/tests/multiplatform/varSetterVisibility.kt"); } + @Test + @TestMetadata("widerVisibilityInActualClassifier.kt") + public void testWiderVisibilityInActualClassifier() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/widerVisibilityInActualClassifier.kt"); + } + @Nested @TestMetadata("compiler/testData/diagnostics/tests/multiplatform/defaultArguments") @TestDataPath("$PROJECT_ROOT") 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 7156a4f3b20..df822fba877 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 @@ -33632,6 +33632,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr public void testValueClasses() throws Exception { runTest("compiler/testData/codegen/box/multiplatform/k2/basic/valueClasses.kt"); } + + @Test + @TestMetadata("widerVisibilityInActualClassifier.kt") + public void testWiderVisibilityInActualClassifier() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/basic/widerVisibilityInActualClassifier.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 051e52fdfae..cf5626e89dc 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 @@ -33632,6 +33632,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo public void testValueClasses() throws Exception { runTest("compiler/testData/codegen/box/multiplatform/k2/basic/valueClasses.kt"); } + + @Test + @TestMetadata("widerVisibilityInActualClassifier.kt") + public void testWiderVisibilityInActualClassifier() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/basic/widerVisibilityInActualClassifier.kt"); + } } @Nested diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/mpp/FirExpectActualMatchingContext.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/mpp/FirExpectActualMatchingContext.kt index f71ce62170b..782e749872b 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/mpp/FirExpectActualMatchingContext.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/mpp/FirExpectActualMatchingContext.kt @@ -40,6 +40,9 @@ class FirExpectActualMatchingContext( override val enumConstructorsAreAlwaysCompatible: Boolean get() = true + override val allowClassActualizationWithWiderVisibility: Boolean + get() = true + private fun CallableSymbolMarker.asSymbol(): FirCallableSymbol<*> = this as FirCallableSymbol<*> private fun FunctionSymbolMarker.asSymbol(): FirFunctionSymbol<*> = this as FirFunctionSymbol<*> private fun PropertySymbolMarker.asSymbol(): FirPropertySymbol = this as FirPropertySymbol diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/actualizer/IrExpectActualMatchingContext.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/actualizer/IrExpectActualMatchingContext.kt index ba210f8b170..f470a06755a 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/actualizer/IrExpectActualMatchingContext.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/actualizer/IrExpectActualMatchingContext.kt @@ -33,6 +33,9 @@ internal abstract class IrExpectActualMatchingContext( val typeContext: IrTypeSystemContext, val expectToActualClassMap: Map ) : ExpectActualMatchingContext, TypeSystemContext by typeContext { + override val allowClassActualizationWithWiderVisibility: Boolean + get() = true + private inline fun CallableSymbolMarker.processIr( onFunction: (IrFunction) -> R, onProperty: (IrProperty) -> R, diff --git a/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/mpp/AbstractExpectActualCompatibilityChecker.kt b/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/mpp/AbstractExpectActualCompatibilityChecker.kt index d5b8418312b..9c0f815bb8c 100644 --- a/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/mpp/AbstractExpectActualCompatibilityChecker.kt +++ b/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/mpp/AbstractExpectActualCompatibilityChecker.kt @@ -106,7 +106,7 @@ object AbstractExpectActualCompatibilityChecker { return Incompatible.Modality } - if (expectClassSymbol.visibility != actualClass.visibility) { + if (!areCompatibleClassVisibilities(expectClassSymbol, actualClass)) { return Incompatible.Visibility } @@ -330,7 +330,7 @@ object AbstractExpectActualCompatibilityChecker { return Incompatible.Modality } - if (!areDeclarationsWithCompatibleVisibilities(expectDeclaration.visibility, expectModality, actualDeclaration.visibility)) { + if (!areCompatibleCallableVisibilities(expectDeclaration.visibility, expectModality, actualDeclaration.visibility)) { return Incompatible.Visibility } @@ -436,7 +436,7 @@ object AbstractExpectActualCompatibilityChecker { Modality.SEALED to enumSetOf(Modality.SEALED), ) - private fun areDeclarationsWithCompatibleVisibilities( + private fun areCompatibleCallableVisibilities( expectVisibility: Visibility, expectModality: Modality?, actualVisibility: Visibility, @@ -451,6 +451,19 @@ object AbstractExpectActualCompatibilityChecker { } } + context(ExpectActualMatchingContext<*>) + private fun areCompatibleClassVisibilities( + expectClassSymbol: RegularClassSymbolMarker, + actualClassSymbol: RegularClassSymbolMarker, + ): Boolean { + val expectVisibility = expectClassSymbol.visibility + val actualVisibility = actualClassSymbol.visibility + if (expectVisibility == actualVisibility) return true + if (!allowClassActualizationWithWiderVisibility) return false + val result = Visibilities.compare(actualVisibility, expectVisibility) + return result != null && result > 0 + } + context(ExpectActualMatchingContext<*>) private fun areCompatibleTypeParameters( expectTypeParameterSymbols: List, @@ -525,7 +538,7 @@ object AbstractExpectActualCompatibilityChecker { ): Boolean { val expectedSetter = expected.setter ?: return true val actualSetter = actual.setter ?: return true - return areDeclarationsWithCompatibleVisibilities(expectedSetter.visibility, expectedSetter.modality, actualSetter.visibility) + return areCompatibleCallableVisibilities(expectedSetter.visibility, expectedSetter.modality, actualSetter.visibility) } // ---------------------------------------- Utils ---------------------------------------- diff --git a/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/mpp/ExpectActualMatchingContext.kt b/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/mpp/ExpectActualMatchingContext.kt index 192943cc8f5..e52f4f5918c 100644 --- a/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/mpp/ExpectActualMatchingContext.kt +++ b/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/mpp/ExpectActualMatchingContext.kt @@ -39,6 +39,17 @@ interface ExpectActualMatchingContext : TypeSystemC val enumConstructorsAreAlwaysCompatible: Boolean get() = false + /** + * This flag determines, how visibilities for classes/typealiases will be matched + * - `false` means that visibilities should be identical + * - `true` means that visibility of actual class should be the same or wider comparing to expect visibility + * this means that following actualizations will be additionally allowed: + * - protected -> public + * - internal -> public + */ + val allowClassActualizationWithWiderVisibility: Boolean + get() = false + val RegularClassSymbolMarker.classId: ClassId val TypeAliasSymbolMarker.classId: ClassId val CallableSymbolMarker.callableId: CallableId diff --git a/compiler/testData/codegen/box/multiplatform/k2/basic/widerVisibilityInActualClassifier.kt b/compiler/testData/codegen/box/multiplatform/k2/basic/widerVisibilityInActualClassifier.kt new file mode 100644 index 00000000000..8b02a6dab10 --- /dev/null +++ b/compiler/testData/codegen/box/multiplatform/k2/basic/widerVisibilityInActualClassifier.kt @@ -0,0 +1,49 @@ +// IGNORE_BACKEND_K1: ANY +// IGNORE_REASON: KT-59355 is fixed only in K2 +// IGNORE_BACKEND_K2: JS_IR +// IGNORE_REASON: `JsName` in js.translator/testData/_commonFiles/testUtils.kt is invisible for some reason +// IGNORE_BACKEND: WASM +// IGNORE_REASON: wasm tests don't support IGNORE_BACKEND_K1 directive +// LANGUAGE: +MultiPlatformProjects +// ISSUE: KT-59355 + +// MODULE: common +// FILE: common.kt +internal expect open class Some() { + protected class ProtectedNested() { + fun foo(): String + } +} + +internal class SomeInheritor : Some() { + fun callFoo(): String { + return ProtectedNested().foo() + } +} + +internal expect open class Other() { + fun bar(): String +} + +fun commonBox(): String { + val x = SomeInheritor().callFoo() + val y = Other().bar() + return x + y +} + +// MODULE: platform-jvm()()(common) +// FILE: main.kt +public actual open class Some actual constructor() { + public actual class ProtectedNested actual constructor() { + actual fun foo(): String = "O" + } +} + +public open class PlatformOther { + fun bar(): String = "K" +} + +internal actual typealias Other = PlatformOther + +fun box(): String = commonBox() + diff --git a/compiler/testData/diagnostics/tests/multiplatform/widerVisibilityInActualClassifier.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/widerVisibilityInActualClassifier.fir.kt new file mode 100644 index 00000000000..01521f243bf --- /dev/null +++ b/compiler/testData/diagnostics/tests/multiplatform/widerVisibilityInActualClassifier.fir.kt @@ -0,0 +1,34 @@ +// ISSUE: KT-59355 + +// MODULE: common +internal expect open class Some { + protected class ProtectedNested + internal class InternalNested + + public fun publicFun() + internal fun internalFun() + protected fun protectedFun() +} + +internal expect open class Other { + protected class ProtectedNested + internal class InternalNested +} + +// MODULE: platform-jvm()()(common) +public actual open class Some { // should be allowed + public class ProtectedNested // should be allowed + public class InternalNested // should be allowed + + public actual fun publicFun() {} // should be allowed + public actual fun internalFun() {} // should be allowed + public actual fun protectedFun() {} // should be allowed +} + +public open class PlatformOther { // should be allowed + public class ProtectedNested // should be allowed + public class InternalNested // should be allowed +} + +internal actual typealias Other = PlatformOther // should be allowed + diff --git a/compiler/testData/diagnostics/tests/multiplatform/widerVisibilityInActualClassifier.kt b/compiler/testData/diagnostics/tests/multiplatform/widerVisibilityInActualClassifier.kt new file mode 100644 index 00000000000..0a464a1b6c7 --- /dev/null +++ b/compiler/testData/diagnostics/tests/multiplatform/widerVisibilityInActualClassifier.kt @@ -0,0 +1,34 @@ +// ISSUE: KT-59355 + +// MODULE: common +internal expect open class Some { + protected class ProtectedNested + internal class InternalNested + + public fun publicFun() + internal fun internalFun() + protected fun protectedFun() +} + +internal expect open class Other { + protected class ProtectedNested + internal class InternalNested +} + +// MODULE: platform-jvm()()(common) +public actual open class Some { // should be allowed + public class ProtectedNested // should be allowed + public class InternalNested // should be allowed + + public actual fun publicFun() {} // should be allowed + public actual fun internalFun() {} // should be allowed + public actual fun protectedFun() {} // should be allowed +} + +public open class PlatformOther { // should be allowed + public class ProtectedNested // should be allowed + public class InternalNested // should be allowed +} + +internal actual typealias Other = PlatformOther // should be allowed + diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java index e9ac5a6328b..45b6db18a89 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java @@ -22486,6 +22486,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/multiplatform/varSetterVisibility.kt"); } + @Test + @TestMetadata("widerVisibilityInActualClassifier.kt") + public void testWiderVisibilityInActualClassifier() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/widerVisibilityInActualClassifier.kt"); + } + @Nested @TestMetadata("compiler/testData/diagnostics/tests/multiplatform/defaultArguments") @TestDataPath("$PROJECT_ROOT") 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 93411313eb9..9d21cf31306 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 @@ -32072,6 +32072,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { public void testRemoveExpectDeclarationsFromMetadata() throws Exception { runTest("compiler/testData/codegen/box/multiplatform/k2/basic/removeExpectDeclarationsFromMetadata.kt"); } + + @Test + @TestMetadata("widerVisibilityInActualClassifier.kt") + public void testWiderVisibilityInActualClassifier() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/basic/widerVisibilityInActualClassifier.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 e44f568f1dc..a3e1e3b65f9 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 @@ -33632,6 +33632,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes public void testValueClasses() throws Exception { runTest("compiler/testData/codegen/box/multiplatform/k2/basic/valueClasses.kt"); } + + @Test + @TestMetadata("widerVisibilityInActualClassifier.kt") + public void testWiderVisibilityInActualClassifier() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/basic/widerVisibilityInActualClassifier.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 8746a538d98..d547f99319d 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 @@ -33632,6 +33632,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack public void testValueClasses() throws Exception { runTest("compiler/testData/codegen/box/multiplatform/k2/basic/valueClasses.kt"); } + + @Test + @TestMetadata("widerVisibilityInActualClassifier.kt") + public void testWiderVisibilityInActualClassifier() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/basic/widerVisibilityInActualClassifier.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 8318dd7ddb9..fb7c02f8de3 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -27349,6 +27349,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes public void testNonExternalEquals() throws Exception { runTest("compiler/testData/codegen/box/multiplatform/k2/basic/nonExternalEquals.kt"); } + + @TestMetadata("widerVisibilityInActualClassifier.kt") + public void testWiderVisibilityInActualClassifier() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/basic/widerVisibilityInActualClassifier.kt"); + } } @TestMetadata("compiler/testData/codegen/box/multiplatform/k2/defaultArguments") 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 6aec8f95674..f6db962c492 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 @@ -23432,6 +23432,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { public void testRemoveExpectDeclarationsFromMetadata() throws Exception { runTest("compiler/testData/codegen/box/multiplatform/k2/basic/removeExpectDeclarationsFromMetadata.kt"); } + + @Test + @TestMetadata("widerVisibilityInActualClassifier.kt") + public void testWiderVisibilityInActualClassifier() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/basic/widerVisibilityInActualClassifier.kt"); + } } @Nested 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 a38f4d32b13..ee9038d6ee0 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 @@ -23594,6 +23594,12 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest { public void testRemoveExpectDeclarationsFromMetadata() throws Exception { runTest("compiler/testData/codegen/box/multiplatform/k2/basic/removeExpectDeclarationsFromMetadata.kt"); } + + @Test + @TestMetadata("widerVisibilityInActualClassifier.kt") + public void testWiderVisibilityInActualClassifier() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/basic/widerVisibilityInActualClassifier.kt"); + } } @Nested 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 b9f0ec84f47..6b135a0339b 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 @@ -23594,6 +23594,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { public void testRemoveExpectDeclarationsFromMetadata() throws Exception { runTest("compiler/testData/codegen/box/multiplatform/k2/basic/removeExpectDeclarationsFromMetadata.kt"); } + + @Test + @TestMetadata("widerVisibilityInActualClassifier.kt") + public void testWiderVisibilityInActualClassifier() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/basic/widerVisibilityInActualClassifier.kt"); + } } @Nested 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 6fb2342b7eb..796b1a66bd5 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 @@ -23594,6 +23594,12 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes public void testRemoveExpectDeclarationsFromMetadata() throws Exception { runTest("compiler/testData/codegen/box/multiplatform/k2/basic/removeExpectDeclarationsFromMetadata.kt"); } + + @Test + @TestMetadata("widerVisibilityInActualClassifier.kt") + public void testWiderVisibilityInActualClassifier() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/basic/widerVisibilityInActualClassifier.kt"); + } } @Nested 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 a68f8c59a57..0f0034d6f8d 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 @@ -26666,6 +26666,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe public void testRemoveExpectDeclarationsFromMetadata() throws Exception { runTest("compiler/testData/codegen/box/multiplatform/k2/basic/removeExpectDeclarationsFromMetadata.kt"); } + + @Test + @TestMetadata("widerVisibilityInActualClassifier.kt") + public void testWiderVisibilityInActualClassifier() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/basic/widerVisibilityInActualClassifier.kt"); + } } @Nested 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 8b2405f4a34..a0bf90f5944 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 @@ -27272,6 +27272,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB public void testRemoveExpectDeclarationsFromMetadata() throws Exception { runTest("compiler/testData/codegen/box/multiplatform/k2/basic/removeExpectDeclarationsFromMetadata.kt"); } + + @Test + @TestMetadata("widerVisibilityInActualClassifier.kt") + public void testWiderVisibilityInActualClassifier() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/basic/widerVisibilityInActualClassifier.kt"); + } } @Nested 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 f99d457a147..87ccbf157bc 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 @@ -26364,6 +26364,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest public void testRemoveExpectDeclarationsFromMetadata() throws Exception { runTest("compiler/testData/codegen/box/multiplatform/k2/basic/removeExpectDeclarationsFromMetadata.kt"); } + + @Test + @TestMetadata("widerVisibilityInActualClassifier.kt") + public void testWiderVisibilityInActualClassifier() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/basic/widerVisibilityInActualClassifier.kt"); + } } @Nested 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 78ec20566c7..4aa2c0b7b32 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 @@ -26667,6 +26667,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT public void testRemoveExpectDeclarationsFromMetadata() throws Exception { runTest("compiler/testData/codegen/box/multiplatform/k2/basic/removeExpectDeclarationsFromMetadata.kt"); } + + @Test + @TestMetadata("widerVisibilityInActualClassifier.kt") + public void testWiderVisibilityInActualClassifier() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/basic/widerVisibilityInActualClassifier.kt"); + } } @Nested 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 aa680bb8ca0..fb1f7d53ac9 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 @@ -20962,6 +20962,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest public void testRemoveExpectDeclarationsFromMetadata() throws Exception { runTest("compiler/testData/codegen/box/multiplatform/k2/basic/removeExpectDeclarationsFromMetadata.kt"); } + + @TestMetadata("widerVisibilityInActualClassifier.kt") + public void testWiderVisibilityInActualClassifier() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/basic/widerVisibilityInActualClassifier.kt"); + } } @TestMetadata("compiler/testData/codegen/box/multiplatform/k2/defaultArguments")