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:
+5
-1
@@ -328,7 +328,11 @@ abstract class CommonCompilerArguments : CommonToolArguments() {
|
|||||||
return HashMap<AnalysisFlag<*>, Any>().apply {
|
return HashMap<AnalysisFlag<*>, Any>().apply {
|
||||||
put(AnalysisFlags.skipMetadataVersionCheck, skipMetadataVersionCheck)
|
put(AnalysisFlags.skipMetadataVersionCheck, skipMetadataVersionCheck)
|
||||||
put(AnalysisFlags.multiPlatformDoNotCheckActual, noCheckActual)
|
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.useExperimental, useExperimental?.toList().orEmpty())
|
||||||
put(AnalysisFlags.explicitApiVersion, apiVersion != null)
|
put(AnalysisFlags.explicitApiVersion, apiVersion != null)
|
||||||
put(AnalysisFlags.allowResultReturnType, allowResultReturnType)
|
put(AnalysisFlags.allowResultReturnType, allowResultReturnType)
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
warning: '-Xexperimental' is deprecated and will be removed in a future release
|
||||||
warning: experimental API marker org.test.Warning2 is deprecated. Warning2
|
warning: experimental API marker org.test.Warning2 is deprecated. Warning2
|
||||||
warning: experimental API marker org.test.Warning1 is deprecated. Warning1
|
warning: experimental API marker org.test.Warning1 is deprecated. Warning1
|
||||||
OK
|
OK
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
warning: '-Xexperimental' is deprecated and will be removed in a future release
|
||||||
warning: class org.test.NotAnAnnotation1 is not an experimental API marker annotation
|
warning: class org.test.NotAnAnnotation1 is not an experimental API marker annotation
|
||||||
warning: class org.test.NotAnAnnotation2 is not an experimental API marker annotation
|
warning: class org.test.NotAnAnnotation2 is not an experimental API marker annotation
|
||||||
OK
|
OK
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
warning: '-Xexperimental' is deprecated and will be removed in a future release
|
||||||
warning: class org.test.NotAMarker1 is not an experimental API marker annotation
|
warning: class org.test.NotAMarker1 is not an experimental API marker annotation
|
||||||
warning: class org.test.NotAMarker2 is not an experimental API marker annotation
|
warning: class org.test.NotAMarker2 is not an experimental API marker annotation
|
||||||
OK
|
OK
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
|
warning: '-Xexperimental' is deprecated and will be removed in a future release
|
||||||
OK
|
OK
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
warning: '-Xexperimental' is deprecated and will be removed in a future release
|
||||||
warning: experimental API marker org.test.Unresolved2 is unresolved. Please make sure it's present in the module dependencies
|
warning: experimental API marker org.test.Unresolved2 is unresolved. Please make sure it's present in the module dependencies
|
||||||
warning: experimental API marker org.test.Unresolved1 is unresolved. Please make sure it's present in the module dependencies
|
warning: experimental API marker org.test.Unresolved1 is unresolved. Please make sure it's present in the module dependencies
|
||||||
warning: experimental API marker org.test.Unresolved3 is unresolved. Please make sure it's present in the module dependencies
|
warning: experimental API marker org.test.Unresolved3 is unresolved. Please make sure it's present in the module dependencies
|
||||||
|
|||||||
Reference in New Issue
Block a user