Deprecate -Xexperimental compiler argument

This option is not widely used and its implementation relies on a
complicated mechanism of a module-wide metadata, which is not properly
supported in the IDE (see IdeModuleAnnotationsResolver).

 #KT-34649 Fixed
This commit is contained in:
Alexander Udalov
2019-12-13 20:25:43 +03:00
parent 571bba7c04
commit 33bc3db144
6 changed files with 10 additions and 1 deletions
@@ -328,7 +328,11 @@ abstract class CommonCompilerArguments : CommonToolArguments() {
return HashMap<AnalysisFlag<*>, Any>().apply {
put(AnalysisFlags.skipMetadataVersionCheck, skipMetadataVersionCheck)
put(AnalysisFlags.multiPlatformDoNotCheckActual, noCheckActual)
put(AnalysisFlags.experimental, experimental?.toList().orEmpty())
val experimentalFqNames = experimental?.toList().orEmpty()
if (experimentalFqNames.isNotEmpty()) {
put(AnalysisFlags.experimental, experimentalFqNames)
collector.report(CompilerMessageSeverity.WARNING, "'-Xexperimental' is deprecated and will be removed in a future release")
}
put(AnalysisFlags.useExperimental, useExperimental?.toList().orEmpty())
put(AnalysisFlags.explicitApiVersion, apiVersion != null)
put(AnalysisFlags.allowResultReturnType, allowResultReturnType)