Add -Xopt-in command line argument

As per https://github.com/Kotlin/KEEP/pull/201
This commit is contained in:
Alexander Udalov
2019-12-17 10:35:04 +01:00
parent cdbabf224f
commit e009c7064e
3 changed files with 10 additions and 1 deletions
@@ -175,6 +175,13 @@ abstract class CommonCompilerArguments : CommonToolArguments() {
)
var useExperimental: Array<String>? by FreezableVar(null)
@Argument(
value = "-Xopt-in",
valueDescription = "<fq.name>",
description = "Enable usages of API that requires opt-in with an opt-in requirement marker with the given fully qualified name"
)
var optIn: Array<String>? 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"
@@ -333,7 +340,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() {
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() + optIn?.toList().orEmpty())
put(AnalysisFlags.explicitApiVersion, apiVersion != null)
put(AnalysisFlags.allowResultReturnType, allowResultReturnType)
ExplicitApiMode.fromString(explicitApi)?.also { put(AnalysisFlags.explicitApiMode, it) } ?: collector.report(
+1
View File
@@ -42,6 +42,7 @@ where advanced options include:
-Xnew-inference Enable new experimental generic type inference algorithm
-Xno-check-actual Do not check presence of 'actual' modifier in multi-platform projects
-Xno-inline Disable method inlining
-Xopt-in=<fq.name> 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
+1
View File
@@ -99,6 +99,7 @@ where advanced options include:
-Xnew-inference Enable new experimental generic type inference algorithm
-Xno-check-actual Do not check presence of 'actual' modifier in multi-platform projects
-Xno-inline Disable method inlining
-Xopt-in=<fq.name> 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