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 dd49a5972e0..93fa780e4cd 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 @@ -13016,6 +13016,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/increment/classVarargGetSet.kt"); } + @TestMetadata("classVarargGetSetEvaluationOrder.kt") + public void testClassVarargGetSetEvaluationOrder() throws Exception { + runTest("compiler/testData/codegen/box/increment/classVarargGetSetEvaluationOrder.kt"); + } + @TestMetadata("classWithGetSet.kt") public void testClassWithGetSet() throws Exception { runTest("compiler/testData/codegen/box/increment/classWithGetSet.kt"); @@ -17861,6 +17866,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT public void testVarargs() throws Exception { runTest("compiler/testData/codegen/box/mixedNamedPosition/varargs.kt"); } + + @TestMetadata("varargsEvaluationOrder.kt") + public void testVarargsEvaluationOrder() throws Exception { + runTest("compiler/testData/codegen/box/mixedNamedPosition/varargsEvaluationOrder.kt"); + } } @TestMetadata("compiler/testData/codegen/box/multiDecl") @@ -31536,6 +31546,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/vararg/emptyVarargOfBoxedPrimitiveType.kt"); } + @TestMetadata("evaluationOrder.kt") + public void testEvaluationOrder() throws Exception { + runTest("compiler/testData/codegen/box/vararg/evaluationOrder.kt"); + } + @TestMetadata("kt1978.kt") public void testKt1978() throws Exception { runTest("compiler/testData/codegen/box/vararg/kt1978.kt"); diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/FirArgumentsToParametersMapper.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/FirArgumentsToParametersMapper.kt index 00c769f6db6..4ac142f1eb8 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/FirArgumentsToParametersMapper.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/FirArgumentsToParametersMapper.kt @@ -29,6 +29,8 @@ data class ArgumentMapping( // fun foo(a: Int, b: Int) {} // foo(b = bar(), a = qux()) // parameterToCallArgumentMap.values() should be [ 'bar()', 'foo()' ] + // TODO: Consider changing this (and other similar declarations like Candidate.argumentMapping) to LinkedHashMap to signify that + // order is important. Right now we're assuming that mutableMapOf() will always return a LinkedHashMap. val parameterToCallArgumentMap: Map, val oldToNewArgumentMap: Map, val diagnostics: List diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/BodyResolveUtils.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/BodyResolveUtils.kt index 76001229918..23176d1f985 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/BodyResolveUtils.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/BodyResolveUtils.kt @@ -40,10 +40,12 @@ internal fun remapArgumentsWithVararg( argumentList: FirArgumentList, argumentMapping: Map ): Map { - // Create a FirVarargArgumentExpression for the vararg arguments + // Create a FirVarargArgumentExpression for the vararg arguments. + // The order of arguments in the mapping must be preserved for FIR2IR, hence we have to find where the vararg arguments end. + // FIR2IR uses the mapping order to determine if arguments need to be reordered. val varargParameterTypeRef = varargParameter.returnTypeRef val varargElementType = varargArrayType.arrayElementType() - var firstIndex = argumentList.arguments.size + var indexAfterVarargs = argumentList.arguments.size val newArgumentMapping = mutableMapOf() val varargArgument = buildVarargArgumentsExpression { this.varargElementType = varargParameterTypeRef.withReplacedConeType(varargElementType) @@ -51,14 +53,26 @@ internal fun remapArgumentsWithVararg( for ((i, arg) in argumentList.arguments.withIndex()) { val valueParameter = argumentMapping[arg] ?: continue if (valueParameter.isVararg) { - firstIndex = min(firstIndex, i) + // `arg` is a vararg argument. arguments += arg - } else { + } else if (arguments.isEmpty()) { + // `arg` is BEFORE the vararg arguments. newArgumentMapping[arg] = valueParameter + } else { + // `arg` is AFTER the vararg arguments. + indexAfterVarargs = i + break } } } newArgumentMapping[varargArgument] = varargParameter + + // Add mapping for arguments after the vararg arguments, if any. + for (i in indexAfterVarargs until argumentList.arguments.size) { + val arg = argumentList.arguments[i] + val valueParameter = argumentMapping[arg] ?: continue + newArgumentMapping[arg] = valueParameter + } return newArgumentMapping } diff --git a/compiler/testData/codegen/box/increment/classVarargGetSetEvaluationOrder.kt b/compiler/testData/codegen/box/increment/classVarargGetSetEvaluationOrder.kt new file mode 100644 index 00000000000..304a9f091d0 --- /dev/null +++ b/compiler/testData/codegen/box/increment/classVarargGetSetEvaluationOrder.kt @@ -0,0 +1,41 @@ +// IGNORE_BACKEND_FIR: JVM_IR +// Currently fails as the indices (`va`) are evaluated twice (on get and set). +var log = "" + +fun logged(value: String) = + value.also { log += value } + +object A { + var x = "" + var gets = "" + var sets = "" + + operator fun get(vararg va: String): String { + for (s in va) { + gets += s + } + log += "get;" + return x + } + + operator fun set(vararg va: String, value: String) { + for (s in va) { + sets += s + } + log += "set;" + x = value + } +} + +operator fun String.inc() = this + logged("inc;") + +fun box(): String { + A.x = "start;" + val xx = A[logged("1;"), logged("2;"), logged("3;")]++ + if (xx != "start;") return "Failed xx: $xx" + if (A.x != "start;inc;") return "Failed A.x: ${A.x}" + if (A.gets != "1;2;3;") return "Failed A.gets: ${A.gets}" + if (A.sets != "1;2;3;") return "Failed A.sets: ${A.sets}" + if (log != "1;2;3;get;inc;set;") return "Failed log: $log" + return "OK" +} diff --git a/compiler/testData/codegen/box/mixedNamedPosition/varargs.kt b/compiler/testData/codegen/box/mixedNamedPosition/varargs.kt index b2f5196341d..e680a11a175 100644 --- a/compiler/testData/codegen/box/mixedNamedPosition/varargs.kt +++ b/compiler/testData/codegen/box/mixedNamedPosition/varargs.kt @@ -19,6 +19,7 @@ fun foo3( ) = "$p1 $p2 ${p3[0].toInt()} ${p3[1].toInt()}" fun box(): String { + if (foo1(1, 2, p2 = "3", p3 = 4.0) != "1 2 3 4") return "fail 1" if (foo1(p1 = *intArrayOf(1, 2), "3", p3 = 4.0) != "1 2 3 4") return "fail 2" if (foo2(p1 = 1, "2", "3", p3 = 4.0) != "1 2 3 4") return "fail 3" diff --git a/compiler/testData/codegen/box/mixedNamedPosition/varargsEvaluationOrder.kt b/compiler/testData/codegen/box/mixedNamedPosition/varargsEvaluationOrder.kt new file mode 100644 index 00000000000..2ce370a8eb0 --- /dev/null +++ b/compiler/testData/codegen/box/mixedNamedPosition/varargsEvaluationOrder.kt @@ -0,0 +1,46 @@ +// !LANGUAGE: +NewInference +MixedNamedArgumentsInTheirOwnPosition +// IGNORE_BACKEND: JVM +// See KT-17691: Wrong argument order in resolved call with varargs. (fixed in JVM_IR) + +var log = "" + +fun logged(value: T): T = + value.also { log += " " + value } + +fun doTest(id: String, expected: String, expectedLog: String, test: () -> String) { + log = "" + val actual = test() + if (actual != expected) throw AssertionError("$id expected: $expected, actual: $actual") + if (log != expectedLog) throw AssertionError("$id expectedLog: $expectedLog, actual: $log") +} + +fun foo1( + vararg p1: Int, + p2: String, + p3: Double +) = "${p1[0]} ${p1[1]} $p2 ${p3.toInt()}" + +fun foo2( + p1: Int, + vararg p2: String, + p3: Double +) = "$p1 ${p2[0]} ${p2[1]} ${p3.toInt()}" + +fun foo3( + p1: Int, + p2: String, + vararg p3: Double +) = "$p1 $p2 ${p3[0].toInt()} ${p3[1].toInt()}" + +fun box(): String { + doTest("test1", "1 2 3 4", " 1 2 3 4.5") { foo1(logged(1), logged(2), p2 = logged("3"), p3 = logged(4.5)) } + doTest("test2", "1 2 3 4", " 1 2 3 4.5") { foo1(p1 = *intArrayOf(logged(1), logged(2)), logged("3"), p3 = logged(4.5)) } + + doTest("test3", "1 2 3 4", " 1 2 3 4.5") { foo2(p1 = logged(1), logged("2"), logged("3"), p3 = logged(4.5)) } + doTest("test4", "1 2 3 4", " 1 2 3 4.5") { foo2(logged(1), p2 = *arrayOf(logged("2"), logged("3")), logged(4.5)) } + + doTest("test5", "1 2 3 4", " 1 2 3.5 4.5") { foo3(p1 = logged(1), logged("2"), logged(3.5), logged(4.5)) } + doTest("test6", "1 2 3 4", " 1 2 3.5 4.5") { foo3(p1 = logged(1), logged("2"), p3 = *doubleArrayOf(logged(3.5), logged(4.5))) } + + return "OK" +} diff --git a/compiler/testData/codegen/box/vararg/evaluationOrder.kt b/compiler/testData/codegen/box/vararg/evaluationOrder.kt new file mode 100644 index 00000000000..7f6af8fd340 --- /dev/null +++ b/compiler/testData/codegen/box/vararg/evaluationOrder.kt @@ -0,0 +1,45 @@ +var log = "" + +fun logged(value: T): T = + value.also { log += value } + +fun doTest(id: String, expected: String, expectedLog: String, test: () -> String) { + log = "" + val actual = test() + if (actual != expected) throw AssertionError("$id expected: $expected, actual: $actual") + if (log != expectedLog) throw AssertionError("$id expectedLog: $expectedLog, actual: $log") +} + +object A { + var sets = "" + + fun f(vararg va: String, a: String = "default_a;", b: String): String { + var ret = "" + for (s in va) { + ret += s + } + return ret + a + b + } + + operator fun set(vararg va: String, value: String) { + for (s in va) { + sets += s + } + log += "set=$value;" + } +} + +operator fun String.inc() = this + logged("inc;") + +fun box(): String { + doTest("test1", "1;2;3;", "1;2;3;value;set=value;;") { + A[logged("1;"), logged("2;"), logged("3;")] = logged("value;") + A.sets + } + + doTest("test2", "1;2;3;default_a;b;", "1;2;3;b;") { A.f(logged("1;"), logged("2;"), logged("3;"), b = logged("b;")) } + doTest("test3", "1;2;3;a;b;", "1;2;3;b;a;") { A.f(logged("1;"), logged("2;"), logged("3;"), b = logged("b;"), a = logged("a;")) } + doTest("test4", "1;2;3;a;b;", "1;2;3;a;b;") { A.f(logged("1;"), logged("2;"), logged("3;"), a = logged("a;"), b = logged("b;")) } + + return "OK" +} diff --git a/compiler/testData/ir/irText/expressions/kt28456a.fir.txt b/compiler/testData/ir/irText/expressions/kt28456a.fir.txt index 48a288dc46b..6f095a6ea18 100644 --- a/compiler/testData/ir/irText/expressions/kt28456a.fir.txt +++ b/compiler/testData/ir/irText/expressions/kt28456a.fir.txt @@ -26,13 +26,10 @@ FILE fqName: fileName:/kt28456a.kt FUN name:testSimpleAssignment visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:.A BLOCK_BODY - BLOCK type=kotlin.Unit origin=ARGUMENTS_REORDERING_FOR_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.IntArray [val] - VARARG type=kotlin.IntArray varargElementType=kotlin.Int - CONST Int type=kotlin.Int value=1 - CONST Int type=kotlin.Int value=2 - CONST Int type=kotlin.Int value=3 - CALL 'public final fun set (vararg i: kotlin.Int, v: kotlin.Int): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=null - $receiver: GET_VAR 'a: .A declared in .testSimpleAssignment' type=.A origin=null - i: GET_VAR 'val tmp_0: kotlin.IntArray [val] declared in .testSimpleAssignment' type=kotlin.IntArray origin=null - v: CONST Int type=kotlin.Int value=0 + CALL 'public final fun set (vararg i: kotlin.Int, v: kotlin.Int): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=null + $receiver: GET_VAR 'a: .A declared in .testSimpleAssignment' type=.A origin=null + i: VARARG type=kotlin.IntArray varargElementType=kotlin.Int + CONST Int type=kotlin.Int value=1 + CONST Int type=kotlin.Int value=2 + CONST Int type=kotlin.Int value=3 + v: CONST Int type=kotlin.Int value=0 diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index d1d593f8163..628c60e731e 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -14411,6 +14411,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/increment/classVarargGetSet.kt"); } + @TestMetadata("classVarargGetSetEvaluationOrder.kt") + public void testClassVarargGetSetEvaluationOrder() throws Exception { + runTest("compiler/testData/codegen/box/increment/classVarargGetSetEvaluationOrder.kt"); + } + @TestMetadata("classWithGetSet.kt") public void testClassWithGetSet() throws Exception { runTest("compiler/testData/codegen/box/increment/classWithGetSet.kt"); @@ -19256,6 +19261,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { public void testVarargs() throws Exception { runTest("compiler/testData/codegen/box/mixedNamedPosition/varargs.kt"); } + + @TestMetadata("varargsEvaluationOrder.kt") + public void testVarargsEvaluationOrder() throws Exception { + runTest("compiler/testData/codegen/box/mixedNamedPosition/varargsEvaluationOrder.kt"); + } } @TestMetadata("compiler/testData/codegen/box/multiDecl") @@ -33302,6 +33312,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/vararg/emptyVarargOfBoxedPrimitiveType.kt"); } + @TestMetadata("evaluationOrder.kt") + public void testEvaluationOrder() throws Exception { + runTest("compiler/testData/codegen/box/vararg/evaluationOrder.kt"); + } + @TestMetadata("kt1978.kt") public void testKt1978() throws Exception { runTest("compiler/testData/codegen/box/vararg/kt1978.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 21a09ddcf4f..7f975927a43 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -14411,6 +14411,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/increment/classVarargGetSet.kt"); } + @TestMetadata("classVarargGetSetEvaluationOrder.kt") + public void testClassVarargGetSetEvaluationOrder() throws Exception { + runTest("compiler/testData/codegen/box/increment/classVarargGetSetEvaluationOrder.kt"); + } + @TestMetadata("classWithGetSet.kt") public void testClassWithGetSet() throws Exception { runTest("compiler/testData/codegen/box/increment/classWithGetSet.kt"); @@ -19234,6 +19239,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class MixedNamedPosition extends AbstractLightAnalysisModeTest { + @TestMetadata("varargsEvaluationOrder.kt") + public void ignoreVarargsEvaluationOrder() throws Exception { + runTest("compiler/testData/codegen/box/mixedNamedPosition/varargsEvaluationOrder.kt"); + } + private void runTest(String testDataFilePath) throws Exception { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } @@ -30936,6 +30946,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/vararg/emptyVarargOfBoxedPrimitiveType.kt"); } + @TestMetadata("evaluationOrder.kt") + public void testEvaluationOrder() throws Exception { + runTest("compiler/testData/codegen/box/vararg/evaluationOrder.kt"); + } + @TestMetadata("kt1978.kt") public void testKt1978() throws Exception { runTest("compiler/testData/codegen/box/vararg/kt1978.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index eb5d2117d72..d1b1639583f 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -13016,6 +13016,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/increment/classVarargGetSet.kt"); } + @TestMetadata("classVarargGetSetEvaluationOrder.kt") + public void testClassVarargGetSetEvaluationOrder() throws Exception { + runTest("compiler/testData/codegen/box/increment/classVarargGetSetEvaluationOrder.kt"); + } + @TestMetadata("classWithGetSet.kt") public void testClassWithGetSet() throws Exception { runTest("compiler/testData/codegen/box/increment/classWithGetSet.kt"); @@ -17861,6 +17866,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes public void testVarargs() throws Exception { runTest("compiler/testData/codegen/box/mixedNamedPosition/varargs.kt"); } + + @TestMetadata("varargsEvaluationOrder.kt") + public void testVarargsEvaluationOrder() throws Exception { + runTest("compiler/testData/codegen/box/mixedNamedPosition/varargsEvaluationOrder.kt"); + } } @TestMetadata("compiler/testData/codegen/box/multiDecl") @@ -31536,6 +31546,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/vararg/emptyVarargOfBoxedPrimitiveType.kt"); } + @TestMetadata("evaluationOrder.kt") + public void testEvaluationOrder() throws Exception { + runTest("compiler/testData/codegen/box/vararg/evaluationOrder.kt"); + } + @TestMetadata("kt1978.kt") public void testKt1978() throws Exception { runTest("compiler/testData/codegen/box/vararg/kt1978.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 34589f70705..da22ec016e3 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 @@ -11161,6 +11161,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes runTest("compiler/testData/codegen/box/increment/classVarargGetSet.kt"); } + @TestMetadata("classVarargGetSetEvaluationOrder.kt") + public void testClassVarargGetSetEvaluationOrder() throws Exception { + runTest("compiler/testData/codegen/box/increment/classVarargGetSetEvaluationOrder.kt"); + } + @TestMetadata("classWithGetSet.kt") public void testClassWithGetSet() throws Exception { runTest("compiler/testData/codegen/box/increment/classWithGetSet.kt"); @@ -14386,6 +14391,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes public void testVarargs() throws Exception { runTest("compiler/testData/codegen/box/mixedNamedPosition/varargs.kt"); } + + @TestMetadata("varargsEvaluationOrder.kt") + public void testVarargsEvaluationOrder() throws Exception { + runTest("compiler/testData/codegen/box/mixedNamedPosition/varargsEvaluationOrder.kt"); + } } @TestMetadata("compiler/testData/codegen/box/multiDecl") @@ -25672,6 +25682,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes runTest("compiler/testData/codegen/box/vararg/doNotCopyImmediatelyCreatedArrays.kt"); } + @TestMetadata("evaluationOrder.kt") + public void testEvaluationOrder() throws Exception { + runTest("compiler/testData/codegen/box/vararg/evaluationOrder.kt"); + } + @TestMetadata("kt1978.kt") public void testKt1978() throws Exception { runTest("compiler/testData/codegen/box/vararg/kt1978.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 87e344a2cbe..4ffca35082c 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 @@ -11161,6 +11161,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/increment/classVarargGetSet.kt"); } + @TestMetadata("classVarargGetSetEvaluationOrder.kt") + public void testClassVarargGetSetEvaluationOrder() throws Exception { + runTest("compiler/testData/codegen/box/increment/classVarargGetSetEvaluationOrder.kt"); + } + @TestMetadata("classWithGetSet.kt") public void testClassWithGetSet() throws Exception { runTest("compiler/testData/codegen/box/increment/classWithGetSet.kt"); @@ -14386,6 +14391,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { public void testVarargs() throws Exception { runTest("compiler/testData/codegen/box/mixedNamedPosition/varargs.kt"); } + + @TestMetadata("varargsEvaluationOrder.kt") + public void testVarargsEvaluationOrder() throws Exception { + runTest("compiler/testData/codegen/box/mixedNamedPosition/varargsEvaluationOrder.kt"); + } } @TestMetadata("compiler/testData/codegen/box/multiDecl") @@ -25672,6 +25682,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/vararg/doNotCopyImmediatelyCreatedArrays.kt"); } + @TestMetadata("evaluationOrder.kt") + public void testEvaluationOrder() throws Exception { + runTest("compiler/testData/codegen/box/vararg/evaluationOrder.kt"); + } + @TestMetadata("kt1978.kt") public void testKt1978() throws Exception { runTest("compiler/testData/codegen/box/vararg/kt1978.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 7f9159b3783..2ed8d7900fa 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 @@ -11226,6 +11226,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/increment/classVarargGetSet.kt"); } + @TestMetadata("classVarargGetSetEvaluationOrder.kt") + public void testClassVarargGetSetEvaluationOrder() throws Exception { + runTest("compiler/testData/codegen/box/increment/classVarargGetSetEvaluationOrder.kt"); + } + @TestMetadata("classWithGetSet.kt") public void testClassWithGetSet() throws Exception { runTest("compiler/testData/codegen/box/increment/classWithGetSet.kt"); @@ -14451,6 +14456,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { public void testVarargs() throws Exception { runTest("compiler/testData/codegen/box/mixedNamedPosition/varargs.kt"); } + + @TestMetadata("varargsEvaluationOrder.kt") + public void testVarargsEvaluationOrder() throws Exception { + runTest("compiler/testData/codegen/box/mixedNamedPosition/varargsEvaluationOrder.kt"); + } } @TestMetadata("compiler/testData/codegen/box/multiDecl") @@ -25687,6 +25697,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/vararg/doNotCopyImmediatelyCreatedArrays.kt"); } + @TestMetadata("evaluationOrder.kt") + public void testEvaluationOrder() throws Exception { + runTest("compiler/testData/codegen/box/vararg/evaluationOrder.kt"); + } + @TestMetadata("kt1978.kt") public void testKt1978() throws Exception { runTest("compiler/testData/codegen/box/vararg/kt1978.kt");