diff --git a/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java index af989b5d944..476cac4a14e 100644 --- a/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java @@ -8535,6 +8535,21 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/defaultArguments/function/innerExtentionFunctionManyArgs.kt"); } + @TestMetadata("kt15971.kt") + public void testKt15971() throws Exception { + runTest("compiler/testData/codegen/box/defaultArguments/function/kt15971.kt"); + } + + @TestMetadata("kt15971_2.kt") + public void testKt15971_2() throws Exception { + runTest("compiler/testData/codegen/box/defaultArguments/function/kt15971_2.kt"); + } + + @TestMetadata("kt15971_3.kt") + public void testKt15971_3() throws Exception { + runTest("compiler/testData/codegen/box/defaultArguments/function/kt15971_3.kt"); + } + @TestMetadata("kt36188.kt") public void testKt36188() throws Exception { runTest("compiler/testData/codegen/box/defaultArguments/function/kt36188.kt"); diff --git a/compiler/testData/codegen/box/defaultArguments/function/kt15971.kt b/compiler/testData/codegen/box/defaultArguments/function/kt15971.kt new file mode 100644 index 00000000000..feec1855fc3 --- /dev/null +++ b/compiler/testData/codegen/box/defaultArguments/function/kt15971.kt @@ -0,0 +1,19 @@ +// IGNORE_BACKEND_FIR: JVM_IR +// IGNORE_BACKEND: JVM +interface Q { + fun foo(a: Double): Double +} + +interface Z { + fun foo(a: Double = 1.0): Double +} + +class R : Q, Z { + override fun foo(a: Double) = a +} + +fun box(): String { + if (R().foo() != 1.0) return "fail 1" + if (R().foo(2.0) != 2.0) return "fail 2" + return "OK" +} diff --git a/compiler/testData/codegen/box/defaultArguments/function/kt15971_2.kt b/compiler/testData/codegen/box/defaultArguments/function/kt15971_2.kt new file mode 100644 index 00000000000..37e713b2899 --- /dev/null +++ b/compiler/testData/codegen/box/defaultArguments/function/kt15971_2.kt @@ -0,0 +1,19 @@ +// IGNORE_BACKEND_FIR: JVM_IR +// IGNORE_BACKEND: JVM +interface Q { + fun foo(a: Double) = 0.0 +} + +interface Z { + fun foo(a: Double = 1.0): Double +} + +class R : Q, Z { + override fun foo(a: Double) = a +} + +fun box(): String { + if (R().foo() != 1.0) return "fail 1" + if (R().foo(2.0) != 2.0) return "fail 2" + return "OK" +} diff --git a/compiler/testData/codegen/box/defaultArguments/function/kt15971_3.kt b/compiler/testData/codegen/box/defaultArguments/function/kt15971_3.kt new file mode 100644 index 00000000000..b43de79557f --- /dev/null +++ b/compiler/testData/codegen/box/defaultArguments/function/kt15971_3.kt @@ -0,0 +1,19 @@ +// IGNORE_BACKEND_FIR: JVM_IR +// IGNORE_BACKEND: JVM +interface Q { + fun foo(a: Double): Double +} + +interface Z { + fun foo(a: Double = 1.0) = 0.0 +} + +class R : Q, Z { + override fun foo(a: Double) = a +} + +fun box(): String { + if (R().foo() != 1.0) return "fail 1" + if (R().foo(2.0) != 2.0) return "fail 2" + return "OK" +} diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index 34aad09a7ac..7850082e7ee 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -9680,6 +9680,21 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/defaultArguments/function/innerExtentionFunctionManyArgs.kt"); } + @TestMetadata("kt15971.kt") + public void testKt15971() throws Exception { + runTest("compiler/testData/codegen/box/defaultArguments/function/kt15971.kt"); + } + + @TestMetadata("kt15971_2.kt") + public void testKt15971_2() throws Exception { + runTest("compiler/testData/codegen/box/defaultArguments/function/kt15971_2.kt"); + } + + @TestMetadata("kt15971_3.kt") + public void testKt15971_3() throws Exception { + runTest("compiler/testData/codegen/box/defaultArguments/function/kt15971_3.kt"); + } + @TestMetadata("kt36188.kt") public void testKt36188() throws Exception { runTest("compiler/testData/codegen/box/defaultArguments/function/kt36188.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 9d4c8b0fb22..4cf8729e1b3 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -9592,6 +9592,21 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/defaultArguments/function/funInTraitChain.kt"); } + @TestMetadata("kt15971.kt") + public void ignoreKt15971() throws Exception { + runTest("compiler/testData/codegen/box/defaultArguments/function/kt15971.kt"); + } + + @TestMetadata("kt15971_2.kt") + public void ignoreKt15971_2() throws Exception { + runTest("compiler/testData/codegen/box/defaultArguments/function/kt15971_2.kt"); + } + + @TestMetadata("kt15971_3.kt") + public void ignoreKt15971_3() throws Exception { + runTest("compiler/testData/codegen/box/defaultArguments/function/kt15971_3.kt"); + } + private void runTest(String testDataFilePath) throws Exception { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index 73a461b4ab4..2861347d121 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -8535,6 +8535,21 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/defaultArguments/function/innerExtentionFunctionManyArgs.kt"); } + @TestMetadata("kt15971.kt") + public void testKt15971() throws Exception { + runTest("compiler/testData/codegen/box/defaultArguments/function/kt15971.kt"); + } + + @TestMetadata("kt15971_2.kt") + public void testKt15971_2() throws Exception { + runTest("compiler/testData/codegen/box/defaultArguments/function/kt15971_2.kt"); + } + + @TestMetadata("kt15971_3.kt") + public void testKt15971_3() throws Exception { + runTest("compiler/testData/codegen/box/defaultArguments/function/kt15971_3.kt"); + } + @TestMetadata("kt36188.kt") public void testKt36188() throws Exception { runTest("compiler/testData/codegen/box/defaultArguments/function/kt36188.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java index 6470d494edb..85400f4f597 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java @@ -7245,6 +7245,21 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/defaultArguments/function/innerExtentionFunctionManyArgs.kt"); } + @TestMetadata("kt15971.kt") + public void testKt15971() throws Exception { + runTest("compiler/testData/codegen/box/defaultArguments/function/kt15971.kt"); + } + + @TestMetadata("kt15971_2.kt") + public void testKt15971_2() throws Exception { + runTest("compiler/testData/codegen/box/defaultArguments/function/kt15971_2.kt"); + } + + @TestMetadata("kt15971_3.kt") + public void testKt15971_3() throws Exception { + runTest("compiler/testData/codegen/box/defaultArguments/function/kt15971_3.kt"); + } + @TestMetadata("kt36188.kt") public void testKt36188() throws Exception { runTest("compiler/testData/codegen/box/defaultArguments/function/kt36188.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index 17d9a3839b7..1a0de0464d4 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -7245,6 +7245,21 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/defaultArguments/function/innerExtentionFunctionManyArgs.kt"); } + @TestMetadata("kt15971.kt") + public void testKt15971() throws Exception { + runTest("compiler/testData/codegen/box/defaultArguments/function/kt15971.kt"); + } + + @TestMetadata("kt15971_2.kt") + public void testKt15971_2() throws Exception { + runTest("compiler/testData/codegen/box/defaultArguments/function/kt15971_2.kt"); + } + + @TestMetadata("kt15971_3.kt") + public void testKt15971_3() throws Exception { + runTest("compiler/testData/codegen/box/defaultArguments/function/kt15971_3.kt"); + } + @TestMetadata("kt36188.kt") public void testKt36188() throws Exception { runTest("compiler/testData/codegen/box/defaultArguments/function/kt36188.kt");