diff --git a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonCompilerArguments.kt b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonCompilerArguments.kt index 73b87217a13..c216740d63e 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonCompilerArguments.kt +++ b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonCompilerArguments.kt @@ -311,7 +311,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { value = "-Xuse-mixed-named-arguments", description = "Enable Support named arguments in their own position even if the result appears as mixed" ) - val useMixedNamedArguments: Boolean by FreezableVar(false) + var useMixedNamedArguments: Boolean by FreezableVar(false) @Argument(value = "-Xdisable-default-scripting-plugin", description = "Do not enable scripting plugin by default") var disableDefaultScriptingPlugin: Boolean by FreezableVar(false) diff --git a/compiler/testData/cli/jvm/useMixedNamedArgumentsFlag.args b/compiler/testData/cli/jvm/useMixedNamedArgumentsFlag.args new file mode 100644 index 00000000000..8a9f459b98f --- /dev/null +++ b/compiler/testData/cli/jvm/useMixedNamedArgumentsFlag.args @@ -0,0 +1,5 @@ +$TESTDATA_DIR$/useMixedNamedArgumentsFlag.kt +-Xuse-mixed-named-arguments +-Xnew-inference +-d +$TEMP_DIR$ diff --git a/compiler/testData/cli/jvm/useMixedNamedArgumentsFlag.kt b/compiler/testData/cli/jvm/useMixedNamedArgumentsFlag.kt new file mode 100644 index 00000000000..3fd75b053f7 --- /dev/null +++ b/compiler/testData/cli/jvm/useMixedNamedArgumentsFlag.kt @@ -0,0 +1,5 @@ +fun foo(x: Int, y: Int, z: Int) {} + +fun test() { + foo(1, y = 2, 3) +} \ No newline at end of file diff --git a/compiler/testData/cli/jvm/useMixedNamedArgumentsFlag.out b/compiler/testData/cli/jvm/useMixedNamedArgumentsFlag.out new file mode 100644 index 00000000000..549db9dc8cd --- /dev/null +++ b/compiler/testData/cli/jvm/useMixedNamedArgumentsFlag.out @@ -0,0 +1,12 @@ +warning: some JAR files in the classpath have the Kotlin Runtime library bundled into them. This may cause difficult to debug problems if there's a different version of the Kotlin Runtime library in the classpath. Consider removing these libraries from the classpath +dist/kotlinc/lib/kotlin-reflect.jar: warning: library has Kotlin runtime bundled into it +compiler/testData/cli/jvm/useMixedNamedArgumentsFlag.kt:1:9: warning: parameter 'x' is never used +fun foo(x: Int, y: Int, z: Int) {} + ^ +compiler/testData/cli/jvm/useMixedNamedArgumentsFlag.kt:1:17: warning: parameter 'y' is never used +fun foo(x: Int, y: Int, z: Int) {} + ^ +compiler/testData/cli/jvm/useMixedNamedArgumentsFlag.kt:1:25: warning: parameter 'z' is never used +fun foo(x: Int, y: Int, z: Int) {} + ^ +OK diff --git a/compiler/tests/org/jetbrains/kotlin/cli/CliTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/cli/CliTestGenerated.java index aa970297258..f7a1897b562 100644 --- a/compiler/tests/org/jetbrains/kotlin/cli/CliTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/cli/CliTestGenerated.java @@ -645,6 +645,11 @@ public class CliTestGenerated extends AbstractCliTest { runTest("compiler/testData/cli/jvm/unsupportedTypeAlias.args"); } + @TestMetadata("useMixedNamedArgumentsFlag.args") + public void testUseMixedNamedArgumentsFlag() throws Exception { + runTest("compiler/testData/cli/jvm/useMixedNamedArgumentsFlag.args"); + } + @TestMetadata("warningJdkWithNoJdk.args") public void testWarningJdkWithNoJdk() throws Exception { runTest("compiler/testData/cli/jvm/warningJdkWithNoJdk.args");