diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrCommonMemberStorage.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrCommonMemberStorage.kt index fd759441392..def4ffbcb0b 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrCommonMemberStorage.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrCommonMemberStorage.kt @@ -45,6 +45,8 @@ class Fir2IrCommonMemberStorage( val functionCache: ConcurrentHashMap = ConcurrentHashMap() + val constructorCache: ConcurrentHashMap = ConcurrentHashMap() + val propertyCache: ConcurrentHashMap = ConcurrentHashMap() val fakeOverridesInClass: MutableMap> = mutableMapOf() diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt index 1f10bada471..7c6192813e4 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt @@ -80,7 +80,7 @@ class Fir2IrDeclarationStorage( private val functionCache: ConcurrentHashMap = commonMemberStorage.functionCache - private val constructorCache: ConcurrentHashMap = ConcurrentHashMap() + private val constructorCache: ConcurrentHashMap = commonMemberStorage.constructorCache private val initializerCache: ConcurrentHashMap = ConcurrentHashMap() diff --git a/compiler/testData/cli/js/firMppWithKlib.args b/compiler/testData/cli/js/firMppWithKlib.args new file mode 100644 index 00000000000..b3457dcc89e --- /dev/null +++ b/compiler/testData/cli/js/firMppWithKlib.args @@ -0,0 +1,11 @@ +$TESTDATA_DIR$/firMppWithKlib/common.kt +$TESTDATA_DIR$/firMppWithKlib/platform.kt +-Xcommon-sources=$TESTDATA_DIR$/firMppWithKlib/common.kt +-language-version +2.0 +-ir-output-dir +$TEMP_DIR$ +-ir-output-name +firMppWithKlib +-XXLanguage\:+MultiPlatformProjects +-Xir-produce-klib-file=true diff --git a/compiler/testData/cli/js/firMppWithKlib.out b/compiler/testData/cli/js/firMppWithKlib.out new file mode 100644 index 00000000000..0afdba6a4b9 --- /dev/null +++ b/compiler/testData/cli/js/firMppWithKlib.out @@ -0,0 +1,11 @@ +warning: ATTENTION! +This build uses unsafe internal compiler arguments: + +-XXLanguage:+MultiPlatformProjects + +This mode is not recommended for production use, +as no stability/compatibility guarantees are given on +compiler or generated code. Use it at your own risk! + +warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features +OK diff --git a/compiler/testData/cli/js/firMppWithKlib/common.kt b/compiler/testData/cli/js/firMppWithKlib/common.kt new file mode 100644 index 00000000000..bc00411157b --- /dev/null +++ b/compiler/testData/cli/js/firMppWithKlib/common.kt @@ -0,0 +1 @@ +class Klass \ No newline at end of file diff --git a/compiler/testData/cli/js/firMppWithKlib/platform.kt b/compiler/testData/cli/js/firMppWithKlib/platform.kt new file mode 100644 index 00000000000..8e392d921a3 --- /dev/null +++ b/compiler/testData/cli/js/firMppWithKlib/platform.kt @@ -0,0 +1,3 @@ +fun foo() { + Klass() +} \ No newline at end of file diff --git a/compiler/tests-gen/org/jetbrains/kotlin/cli/CliTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/cli/CliTestGenerated.java index 819002b2c72..60851eb1b78 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/cli/CliTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/cli/CliTestGenerated.java @@ -1328,6 +1328,11 @@ public class CliTestGenerated extends AbstractCliTest { runTest("compiler/testData/cli/js/firMpp.args"); } + @TestMetadata("firMppWithKlib.args") + public void testFirMppWithKlib() throws Exception { + runTest("compiler/testData/cli/js/firMppWithKlib.args"); + } + @TestMetadata("inlineCycle.args") public void testInlineCycle() throws Exception { runTest("compiler/testData/cli/js/inlineCycle.args");