From 8e8a6e6108449a7d1f6ad9eed962849842b2cdef Mon Sep 17 00:00:00 2001 From: Ilmir Usmanov Date: Mon, 29 Nov 2021 19:25:57 +0100 Subject: [PATCH] Do not count receivers in default parameters mask If we implement default function with default parameters in inline class, the receivers will be added to parameter list (see ac7538a269f1349e4365366effb3be60e8b54946). But since they are not present in source parameters, we should not count them when we compute mask for default parameters. #KT-49977 Fixed --- .../FirBlackBoxCodegenTestGenerated.java | 34 ++++++++++++++++++ .../lower/DefaultArgumentStubGenerator.kt | 2 +- .../all-compatibility.kt | 24 +++++++++++++ .../defaultWithDefaultParameter/all.kt | 25 +++++++++++++ .../compatibility.kt | 24 +++++++++++++ .../defaultWithDefaultParameter/default.kt | 23 ++++++++++++ .../all-compatibility.kt | 3 +- .../all.kt | 3 +- .../compatibility.kt | 3 +- .../default.kt | 3 +- .../codegen/BlackBoxCodegenTestGenerated.java | 34 ++++++++++++++++++ .../IrBlackBoxCodegenTestGenerated.java | 34 ++++++++++++++++++ .../LightAnalysisModeTestGenerated.java | 33 +++++++++++++++++ .../js/test/JsCodegenBoxTestGenerated.java | 10 ++++++ .../test/ir/IrJsCodegenBoxTestGenerated.java | 10 ++++++ .../IrCodegenBoxWasmTestGenerated.java | 13 +++++++ .../NativeExtBlackBoxTestGenerated.java | 35 +++++++++++++++++++ 17 files changed, 304 insertions(+), 9 deletions(-) create mode 100644 compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/all-compatibility.kt create mode 100644 compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/all.kt create mode 100644 compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/compatibility.kt create mode 100644 compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/default.kt 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 10d99f1d20b..ef3b7263a70 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 @@ -20727,6 +20727,40 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/kt27416.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter") + @TestDataPath("$PROJECT_ROOT") + public class DefaultWithDefaultParameter { + @Test + @TestMetadata("all.kt") + public void testAll() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/all.kt"); + } + + @Test + public void testAllFilesPresentInDefaultWithDefaultParameter() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("all-compatibility.kt") + public void testAll_compatibility() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/all-compatibility.kt"); + } + + @Test + @TestMetadata("compatibility.kt") + public void testCompatibility() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/compatibility.kt"); + } + + @Test + @TestMetadata("default.kt") + public void testDefault() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/default.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/DefaultArgumentStubGenerator.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/DefaultArgumentStubGenerator.kt index 32e96cea43b..3bcf63dea73 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/DefaultArgumentStubGenerator.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/DefaultArgumentStubGenerator.kt @@ -416,7 +416,7 @@ open class DefaultParameterInjector( listOfNotNull(stubFunction.dispatchReceiverParameter, stubFunction.extensionReceiverParameter) else emptyList() return stubFunction.symbol to (valueParametersPrefix + stubFunction.valueParameters).mapIndexed { i, parameter -> - if (!parameter.isMovedReceiver()) { + if (!parameter.isMovedReceiver() && parameter != stubFunction.dispatchReceiverParameter && parameter != stubFunction.extensionReceiverParameter) { ++sourceParameterIndex } when { diff --git a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/all-compatibility.kt b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/all-compatibility.kt new file mode 100644 index 00000000000..2efddef968b --- /dev/null +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/all-compatibility.kt @@ -0,0 +1,24 @@ +// WITH_STDLIB + +// !JVM_DEFAULT_MODE: all-compatibility +// TARGET_BACKEND: JVM +// IGNORE_BACKEND: JVM +// JVM_TARGET: 1.8 + +interface Path { + fun dispatch(s: String = "K") = "dispatch$s" + fun Int.extension(s: String = "K") = "${this}extension$s" +} + +@JvmInline +value class RealPath(val x: Int) : Path + +fun box(): String { + val rp = RealPath(1) + val res = "${rp.dispatch()};${rp.dispatch("KK")};" + + with(rp) { + "${1.extension()};${2.extension("KK")}" + } + if (res != "dispatchK;dispatchKK;1extensionK;2extensionKK") return res + return "OK" +} diff --git a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/all.kt b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/all.kt new file mode 100644 index 00000000000..5af386a73c7 --- /dev/null +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/all.kt @@ -0,0 +1,25 @@ +// WITH_STDLIB + +// !JVM_DEFAULT_MODE: all +// TARGET_BACKEND: JVM +// IGNORE_BACKEND: JVM +// JVM_TARGET: 1.8 + +interface Path { + fun dispatch(s: String = "K") = "dispatch$s" + fun Int.extension(s: String = "K") = "${this}extension$s" +} + +@JvmInline +value class RealPath(val x: Int) : Path + +fun box(): String { + val rp = RealPath(1) + val res = "${rp.dispatch()};${rp.dispatch("KK")};" + + with(rp) { + "${1.extension()};${2.extension("KK")}" + } + if (res != "dispatchK;dispatchKK;1extensionK;2extensionKK") return res + return "OK" +} + diff --git a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/compatibility.kt b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/compatibility.kt new file mode 100644 index 00000000000..55699ed88b9 --- /dev/null +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/compatibility.kt @@ -0,0 +1,24 @@ +// WITH_STDLIB + +// !JVM_DEFAULT_MODE: compatibility +// TARGET_BACKEND: JVM +// IGNORE_BACKEND: JVM +// JVM_TARGET: 1.8 + +interface Path { + fun dispatch(s: String = "K") = "dispatch$s" + fun Int.extension(s: String = "K") = "${this}extension$s" +} + +@JvmInline +value class RealPath(val x: Int) : Path + +fun box(): String { + val rp = RealPath(1) + val res = "${rp.dispatch()};${rp.dispatch("KK")};" + + with(rp) { + "${1.extension()};${2.extension("KK")}" + } + if (res != "dispatchK;dispatchKK;1extensionK;2extensionKK") return res + return "OK" +} diff --git a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/default.kt b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/default.kt new file mode 100644 index 00000000000..9bec2adafa4 --- /dev/null +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/default.kt @@ -0,0 +1,23 @@ +// WITH_STDLIB + +// TARGET_BACKEND: JVM +// IGNORE_BACKEND: JVM +// JVM_TARGET: 1.8 + +interface Path { + fun dispatch(s: String = "K") = "dispatch$s" + fun Int.extension(s: String = "K") = "${this}extension$s" +} + +@JvmInline +value class RealPath(val x: Int) : Path + +fun box(): String { + val rp = RealPath(1) + val res = "${rp.dispatch()};${rp.dispatch("KK")};" + + with(rp) { + "${1.extension()};${2.extension("KK")}" + } + if (res != "dispatchK;dispatchKK;1extensionK;2extensionKK") return res + return "OK" +} diff --git a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/all-compatibility.kt b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/all-compatibility.kt index f9527459fcc..2ee66bee709 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/all-compatibility.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/all-compatibility.kt @@ -10,8 +10,7 @@ interface Path { fun Int.extension(maxDepth: Int = 42) } -@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") -@kotlin.jvm.JvmInline +@JvmInline value class RealPath(val x: Int) : Path { override fun dispatch(maxDepth: Int) = Unit diff --git a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/all.kt b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/all.kt index 03c460d0433..cb8ca70676b 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/all.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/all.kt @@ -10,8 +10,7 @@ interface Path { fun Int.extension(maxDepth: Int = 42) } -@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") -@kotlin.jvm.JvmInline +@JvmInline value class RealPath(val x: Int) : Path { override fun dispatch(maxDepth: Int) = Unit diff --git a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/compatibility.kt b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/compatibility.kt index e16a11bc0ff..de538315dc7 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/compatibility.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/compatibility.kt @@ -10,8 +10,7 @@ interface Path { fun Int.extension(maxDepth: Int = 42) } -@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") -@kotlin.jvm.JvmInline +@JvmInline value class RealPath(val x: Int) : Path { override fun dispatch(maxDepth: Int) = Unit diff --git a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/default.kt b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/default.kt index 1e3c90d90b8..1f3ce5d6e95 100644 --- a/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/default.kt +++ b/compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter/default.kt @@ -9,8 +9,7 @@ interface Path { fun Int.extension(maxDepth: Int = 42) } -@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE") -@kotlin.jvm.JvmInline +@JvmInline value class RealPath(val x: Int) : Path { override fun dispatch(maxDepth: Int) = Unit 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 83ac0291bdb..fafddec17cb 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 @@ -20565,6 +20565,40 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/kt27416.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter") + @TestDataPath("$PROJECT_ROOT") + public class DefaultWithDefaultParameter { + @Test + @TestMetadata("all.kt") + public void testAll() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/all.kt"); + } + + @Test + public void testAllFilesPresentInDefaultWithDefaultParameter() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @Test + @TestMetadata("all-compatibility.kt") + public void testAll_compatibility() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/all-compatibility.kt"); + } + + @Test + @TestMetadata("compatibility.kt") + public void testCompatibility() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/compatibility.kt"); + } + + @Test + @TestMetadata("default.kt") + public void testDefault() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/default.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter") @TestDataPath("$PROJECT_ROOT") 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 761424ba6ee..b78d8901e30 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 @@ -20727,6 +20727,40 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/kt27416.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter") + @TestDataPath("$PROJECT_ROOT") + public class DefaultWithDefaultParameter { + @Test + @TestMetadata("all.kt") + public void testAll() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/all.kt"); + } + + @Test + public void testAllFilesPresentInDefaultWithDefaultParameter() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("all-compatibility.kt") + public void testAll_compatibility() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/all-compatibility.kt"); + } + + @Test + @TestMetadata("compatibility.kt") + public void testCompatibility() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/compatibility.kt"); + } + + @Test + @TestMetadata("default.kt") + public void testDefault() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/default.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 8868a3ee78f..aa1bd992dea 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -17098,6 +17098,39 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/kt27416.kt"); } + @TestMetadata("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class DefaultWithDefaultParameter extends AbstractLightAnalysisModeTest { + @TestMetadata("all.kt") + public void ignoreAll() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/all.kt"); + } + + @TestMetadata("all-compatibility.kt") + public void ignoreAll_compatibility() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/all-compatibility.kt"); + } + + @TestMetadata("compatibility.kt") + public void ignoreCompatibility() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/compatibility.kt"); + } + + @TestMetadata("default.kt") + public void ignoreDefault() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/default.kt"); + } + + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInDefaultWithDefaultParameter() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + } + @TestMetadata("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) 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 5def178de5c..80f340e363d 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 @@ -16349,6 +16349,16 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/kt27416.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter") + @TestDataPath("$PROJECT_ROOT") + public class DefaultWithDefaultParameter { + @Test + public void testAllFilesPresentInDefaultWithDefaultParameter() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter") @TestDataPath("$PROJECT_ROOT") 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 6bb62c951a3..d7b58711680 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 @@ -16313,6 +16313,16 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/kt27416.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter") + @TestDataPath("$PROJECT_ROOT") + public class DefaultWithDefaultParameter { + @Test + public void testAllFilesPresentInDefaultWithDefaultParameter() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter") @TestDataPath("$PROJECT_ROOT") diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testOld/wasm/semantics/IrCodegenBoxWasmTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testOld/wasm/semantics/IrCodegenBoxWasmTestGenerated.java index 686438c4526..9ccf386bc25 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testOld/wasm/semantics/IrCodegenBoxWasmTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testOld/wasm/semantics/IrCodegenBoxWasmTestGenerated.java @@ -13730,6 +13730,19 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/kt27416.kt"); } + @TestMetadata("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class DefaultWithDefaultParameter extends AbstractIrCodegenBoxWasmTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.WASM, testDataFilePath); + } + + public void testAllFilesPresentInDefaultWithDefaultParameter() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); + } + } + @TestMetadata("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeExtBlackBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeExtBlackBoxTestGenerated.java index 50be559e5e7..3f2d9448c75 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeExtBlackBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeExtBlackBoxTestGenerated.java @@ -20939,6 +20939,41 @@ public class NativeExtBlackBoxTestGenerated extends AbstractNativeBlackBoxTest { runTest("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/kt27416.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter") + @TestDataPath("$PROJECT_ROOT") + @NativeBlackBoxTestCaseGroupProvider(ExtTestCaseGroupProvider.class) + public class DefaultWithDefaultParameter { + @Test + @TestMetadata("all.kt") + public void testAll() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/all.kt"); + } + + @Test + public void testAllFilesPresentInDefaultWithDefaultParameter() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("all-compatibility.kt") + public void testAll_compatibility() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/all-compatibility.kt"); + } + + @Test + @TestMetadata("compatibility.kt") + public void testCompatibility() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/compatibility.kt"); + } + + @Test + @TestMetadata("default.kt") + public void testDefault() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/defaultWithDefaultParameter/default.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/inlineClasses/defaultParameterValues/overrideFunctionWithDefaultParameter") @TestDataPath("$PROJECT_ROOT")