From c14dcfce4f3271360ba706c82e43acc9dfa995ad Mon Sep 17 00:00:00 2001 From: Ivan Kochurkin Date: Tue, 21 Mar 2023 13:28:02 +0100 Subject: [PATCH] [K2, MPP, JS] Fix a compiler crash on transitive common dependencies ^KT-57431 Fixed --- .../box/multiplatform/k2/annotations/optionalExpectation.kt | 3 +-- .../multiplatform/k2/basic/independentCommonSourceModules.kt | 2 -- .../kotlin/test/services/impl/ModuleStructureExtractorImpl.kt | 4 ++-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/compiler/testData/codegen/box/multiplatform/k2/annotations/optionalExpectation.kt b/compiler/testData/codegen/box/multiplatform/k2/annotations/optionalExpectation.kt index 263d657ec53..e32852e5bf8 100644 --- a/compiler/testData/codegen/box/multiplatform/k2/annotations/optionalExpectation.kt +++ b/compiler/testData/codegen/box/multiplatform/k2/annotations/optionalExpectation.kt @@ -2,9 +2,8 @@ // !OPT_IN: kotlin.ExperimentalMultiplatform // IGNORE_BACKEND: WASM // IGNORE_BACKEND_K1: JVM, JVM_IR, JS, JS_IR, JS_IR_ES6, NATIVE -// IGNORE_BACKEND_K2: JS_IR -// KT-57181 // IGNORE_BACKEND_K2: NATIVE +// KT-57181 // WITH_STDLIB // MODULE: common diff --git a/compiler/testData/codegen/box/multiplatform/k2/basic/independentCommonSourceModules.kt b/compiler/testData/codegen/box/multiplatform/k2/basic/independentCommonSourceModules.kt index be44b787168..3c34b691eb3 100644 --- a/compiler/testData/codegen/box/multiplatform/k2/basic/independentCommonSourceModules.kt +++ b/compiler/testData/codegen/box/multiplatform/k2/basic/independentCommonSourceModules.kt @@ -1,7 +1,5 @@ // IGNORE_BACKEND_K1: JS, JS_IR, JS_IR_ES6 -// IGNORE_BACKEND_K2: JS_IR // !LANGUAGE: +MultiPlatformProjects -// TODO: K2 JS_IR Fail Reason: IrSimpleFunctionPublicSymbolImpl for kotlin/assertArrayEquals|-1961670457646030164[0] is already bound... // MODULE: common1 // TARGET_PLATFORM: Common diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/impl/ModuleStructureExtractorImpl.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/impl/ModuleStructureExtractorImpl.kt index f44362c271a..ad05c2f0526 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/impl/ModuleStructureExtractorImpl.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/impl/ModuleStructureExtractorImpl.kt @@ -355,10 +355,9 @@ class ModuleStructureExtractorImpl( directives = moduleDirectives, languageVersionSettings = currentModuleLanguageVersionSettingsBuilder.build() ) - modules += testModule if (testModule.frontendKind != FrontendKinds.FIR || !testModule.languageVersionSettings.supportsFeature(LanguageFeature.MultiPlatformProjects) || - testModule.dependsOnDependencies.isEmpty() + modules.isEmpty() ) { additionalSourceProviders.flatMapTo(filesOfCurrentModule) { additionalSourceProvider -> additionalSourceProvider.produceAdditionalFiles( @@ -371,6 +370,7 @@ class ModuleStructureExtractorImpl( } } } + modules += testModule firstFileInModule = true resetModuleCaches() }