From 8990344bb295586f4ce78b9e55f0400a391d155a Mon Sep 17 00:00:00 2001 From: Georgy Bronnikov Date: Wed, 9 Sep 2020 20:44:27 +0300 Subject: [PATCH] Varargs: add test --- .../codegen/ir/FirBlackBoxCodegenTestGenerated.java | 5 +++++ .../localFunctions/boundTypeParameterInVararg.kt | 10 ++++++++++ .../kotlin/codegen/BlackBoxCodegenTestGenerated.java | 5 +++++ .../kotlin/codegen/LightAnalysisModeTestGenerated.java | 5 +++++ .../codegen/ir/IrBlackBoxCodegenTestGenerated.java | 5 +++++ .../es6/semantics/IrJsCodegenBoxES6TestGenerated.java | 5 +++++ .../test/ir/semantics/IrJsCodegenBoxTestGenerated.java | 5 +++++ .../js/test/semantics/JsCodegenBoxTestGenerated.java | 5 +++++ 8 files changed, 45 insertions(+) create mode 100644 compiler/testData/codegen/box/functions/localFunctions/boundTypeParameterInVararg.kt 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 01551fc971b..64cecfab7c5 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 @@ -12481,6 +12481,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/functions/localFunctions/boundTypeParameterInSupertype.kt"); } + @TestMetadata("boundTypeParameterInVararg.kt") + public void testBoundTypeParameterInVararg() throws Exception { + runTest("compiler/testData/codegen/box/functions/localFunctions/boundTypeParameterInVararg.kt"); + } + @TestMetadata("callBetweenLocalFunctions.kt") public void testCallBetweenLocalFunctions() throws Exception { runTest("compiler/testData/codegen/box/functions/localFunctions/callBetweenLocalFunctions.kt"); diff --git a/compiler/testData/codegen/box/functions/localFunctions/boundTypeParameterInVararg.kt b/compiler/testData/codegen/box/functions/localFunctions/boundTypeParameterInVararg.kt new file mode 100644 index 00000000000..262528c33f8 --- /dev/null +++ b/compiler/testData/codegen/box/functions/localFunctions/boundTypeParameterInVararg.kt @@ -0,0 +1,10 @@ + +fun f(x: T): T { + fun g(vararg xs: T): T { + return xs[0] + } + + return g(x) +} + +fun box() = f("OK") diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index c6400860082..8424b24f480 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -13876,6 +13876,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/functions/localFunctions/boundTypeParameterInSupertype.kt"); } + @TestMetadata("boundTypeParameterInVararg.kt") + public void testBoundTypeParameterInVararg() throws Exception { + runTest("compiler/testData/codegen/box/functions/localFunctions/boundTypeParameterInVararg.kt"); + } + @TestMetadata("callBetweenLocalFunctions.kt") public void testCallBetweenLocalFunctions() throws Exception { runTest("compiler/testData/codegen/box/functions/localFunctions/callBetweenLocalFunctions.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index c409fd54958..a6dfc1fece1 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -13876,6 +13876,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/functions/localFunctions/boundTypeParameterInSupertype.kt"); } + @TestMetadata("boundTypeParameterInVararg.kt") + public void testBoundTypeParameterInVararg() throws Exception { + runTest("compiler/testData/codegen/box/functions/localFunctions/boundTypeParameterInVararg.kt"); + } + @TestMetadata("callBetweenLocalFunctions.kt") public void testCallBetweenLocalFunctions() throws Exception { runTest("compiler/testData/codegen/box/functions/localFunctions/callBetweenLocalFunctions.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index ae27f941867..ee5f9db79c3 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -12481,6 +12481,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/functions/localFunctions/boundTypeParameterInSupertype.kt"); } + @TestMetadata("boundTypeParameterInVararg.kt") + public void testBoundTypeParameterInVararg() throws Exception { + runTest("compiler/testData/codegen/box/functions/localFunctions/boundTypeParameterInVararg.kt"); + } + @TestMetadata("callBetweenLocalFunctions.kt") public void testCallBetweenLocalFunctions() throws Exception { runTest("compiler/testData/codegen/box/functions/localFunctions/callBetweenLocalFunctions.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java index af1dfa9ee92..56f07d8abd2 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java @@ -10736,6 +10736,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes runTest("compiler/testData/codegen/box/functions/localFunctions/boundTypeParameterInSupertype.kt"); } + @TestMetadata("boundTypeParameterInVararg.kt") + public void testBoundTypeParameterInVararg() throws Exception { + runTest("compiler/testData/codegen/box/functions/localFunctions/boundTypeParameterInVararg.kt"); + } + @TestMetadata("callBetweenLocalFunctions.kt") public void testCallBetweenLocalFunctions() throws Exception { runTest("compiler/testData/codegen/box/functions/localFunctions/callBetweenLocalFunctions.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 d50fa81ad64..af0eb861f41 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 @@ -10736,6 +10736,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/functions/localFunctions/boundTypeParameterInSupertype.kt"); } + @TestMetadata("boundTypeParameterInVararg.kt") + public void testBoundTypeParameterInVararg() throws Exception { + runTest("compiler/testData/codegen/box/functions/localFunctions/boundTypeParameterInVararg.kt"); + } + @TestMetadata("callBetweenLocalFunctions.kt") public void testCallBetweenLocalFunctions() throws Exception { runTest("compiler/testData/codegen/box/functions/localFunctions/callBetweenLocalFunctions.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 9a2078aed2a..49c89a64aa2 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 @@ -10736,6 +10736,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/functions/localFunctions/boundTypeParameterInSupertype.kt"); } + @TestMetadata("boundTypeParameterInVararg.kt") + public void testBoundTypeParameterInVararg() throws Exception { + runTest("compiler/testData/codegen/box/functions/localFunctions/boundTypeParameterInVararg.kt"); + } + @TestMetadata("callBetweenLocalFunctions.kt") public void testCallBetweenLocalFunctions() throws Exception { runTest("compiler/testData/codegen/box/functions/localFunctions/callBetweenLocalFunctions.kt");