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 4f7a6380c40..fae302574ef 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 @@ -75,8 +75,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument( value = "-opt-in", - // Uncomment after deletion of optInDeprecated - // deprecatedName = "-Xopt-in", + deprecatedName = "-Xopt-in", valueDescription = "", description = "Enable usages of API that requires opt-in with an opt-in requirement marker with the given fully qualified name" ) @@ -166,14 +165,6 @@ abstract class CommonCompilerArguments : CommonToolArguments() { ) var useExperimental: Array? by FreezableVar(null) - // NB: we have to keep this flag for some time due to bootstrapping problems - @Argument( - value = "-Xopt-in", - valueDescription = "", - description = "Enable usages of API that requires opt-in with an opt-in requirement marker with the given fully qualified name" - ) - var optInDeprecated: Array? by FreezableVar(null) - @Argument( value = "-Xproper-ieee754-comparisons", description = "Generate proper IEEE 754 comparisons in all cases if values are statically known to be of primitive numeric types" @@ -410,6 +401,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { @Argument(value = "-Xrender-internal-diagnostic-names", description = "Render internal names of warnings and errors") var renderInternalDiagnosticNames: Boolean by FreezableVar(false) + @OptIn(IDEAPluginsCompatibilityAPI::class) open fun configureAnalysisFlags(collector: MessageCollector, languageVersion: LanguageVersion): MutableMap, Any> { return HashMap, Any>().apply { put(AnalysisFlags.skipMetadataVersionCheck, skipMetadataVersionCheck) @@ -421,13 +413,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() { WARNING, "'-Xuse-experimental' is deprecated and will be removed in a future release, please use -opt-in instead" ) } - val optInDeprecatedFqNames = optInDeprecated?.toList().orEmpty() - if (optInDeprecatedFqNames.isNotEmpty()) { - collector.report( - WARNING, "'-Xopt-in' is deprecated and will be removed in a future release, please use -opt-in instead" - ) - } - put(AnalysisFlags.optIn, useExperimentalFqNames + optInDeprecatedFqNames + optIn?.toList().orEmpty()) + put(AnalysisFlags.optIn, useExperimentalFqNames + optIn?.toList().orEmpty()) put(AnalysisFlags.expectActualLinker, expectActualLinker) put(AnalysisFlags.explicitApiVersion, apiVersion != null) put(AnalysisFlags.allowResultReturnType, allowResultReturnType) diff --git a/compiler/testData/cli/js/jsExtraHelp.out b/compiler/testData/cli/js/jsExtraHelp.out index 0e4d2327548..3169c802ecc 100644 --- a/compiler/testData/cli/js/jsExtraHelp.out +++ b/compiler/testData/cli/js/jsExtraHelp.out @@ -79,7 +79,6 @@ where advanced options include: -Xno-check-actual Do not check presence of 'actual' modifier in multi-platform projects -Xno-inline Disable method inlining -Xklib-normalize-absolute-path Normalize absolute paths in klibs - -Xopt-in= Enable usages of API that requires opt-in with an opt-in requirement marker with the given fully qualified name -Xphases-to-dump Dump backend state both before and after these phases -Xphases-to-dump-after Dump backend state after these phases -Xphases-to-dump-before Dump backend state before these phases diff --git a/compiler/testData/cli/jvm/experimentalDeprecatedWarning.args b/compiler/testData/cli/jvm/experimentalDeprecatedWarning.args index 0d35c31cbd4..2c811785c3d 100644 --- a/compiler/testData/cli/jvm/experimentalDeprecatedWarning.args +++ b/compiler/testData/cli/jvm/experimentalDeprecatedWarning.args @@ -4,4 +4,4 @@ $TEMP_DIR$ -Xopt-in=kotlin.RequiresOptIn -opt-in=kotlin.RequiresOptIn -opt-in=org.test.Warning --Xuse-experimental=org.test.OneMore + diff --git a/compiler/testData/cli/jvm/experimentalDeprecatedWarning.out b/compiler/testData/cli/jvm/experimentalDeprecatedWarning.out index 65c806d1e57..8d939d49e07 100644 --- a/compiler/testData/cli/jvm/experimentalDeprecatedWarning.out +++ b/compiler/testData/cli/jvm/experimentalDeprecatedWarning.out @@ -1,4 +1,3 @@ -warning: '-Xuse-experimental' is deprecated and will be removed in a future release, please use -opt-in instead -warning: '-Xopt-in' is deprecated and will be removed in a future release, please use -opt-in instead +warning: flag is not supported by this version of the compiler: -Xopt-in=kotlin.RequiresOptIn warning: opt-in requirement marker org.test.Warning is deprecated. Warning OK diff --git a/compiler/testData/cli/jvm/extraHelp.out b/compiler/testData/cli/jvm/extraHelp.out index 718b7579415..b1d602b13ff 100644 --- a/compiler/testData/cli/jvm/extraHelp.out +++ b/compiler/testData/cli/jvm/extraHelp.out @@ -184,7 +184,6 @@ where advanced options include: -Xno-check-actual Do not check presence of 'actual' modifier in multi-platform projects -Xno-inline Disable method inlining -Xklib-normalize-absolute-path Normalize absolute paths in klibs - -Xopt-in= Enable usages of API that requires opt-in with an opt-in requirement marker with the given fully qualified name -Xphases-to-dump Dump backend state both before and after these phases -Xphases-to-dump-after Dump backend state after these phases -Xphases-to-dump-before Dump backend state before these phases diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/support/group/ExtTestCaseGroupProvider.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/support/group/ExtTestCaseGroupProvider.kt index 374cd93203a..624406a6444 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/support/group/ExtTestCaseGroupProvider.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/support/group/ExtTestCaseGroupProvider.kt @@ -150,7 +150,7 @@ private class ExtTestDataFile( private fun assembleFreeCompilerArgs(): TestCompilerArgs { val args = mutableListOf() testDataFileSettings.languageSettings.sorted().mapTo(args) { "-XXLanguage:$it" } - testDataFileSettings.optInsForCompiler.sorted().mapTo(args) { "-Xopt-in=$it" } + testDataFileSettings.optInsForCompiler.sorted().mapTo(args) { "-opt-in=$it" } if (testDataFileSettings.expectActualLinker) args += "-Xexpect-actual-linker" return TestCompilerArgs(args) }