From 944ee8fcd50154412a7a0cebf5321f13f1638b94 Mon Sep 17 00:00:00 2001 From: Victor Petukhov Date: Fri, 26 Jul 2019 08:56:04 +0300 Subject: [PATCH] Introduce `-Xinline-classes` compiler flag as more priority than `-XXLanguage:+InlineClasses` --- .../cli/common/arguments/CommonCompilerArguments.kt | 10 ++++++++++ compiler/testData/cli/js/jsExtraHelp.out | 1 + compiler/testData/cli/jvm/extraHelp.out | 1 + 3 files changed, 12 insertions(+) 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 9c1cb32de77..bc9e4b8e318 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 @@ -128,6 +128,12 @@ abstract class CommonCompilerArguments : CommonToolArguments() { ) var newInference: Boolean by FreezableVar(false) + @Argument( + value = "-Xinline-classes", + description = "Enable experimental inline classes" + ) + var inlineClasses: Boolean by FreezableVar(false) + @Argument( value = "-Xlegacy-smart-cast-after-try", description = "Allow var smart casts despite assignment in try block" @@ -326,6 +332,10 @@ abstract class CommonCompilerArguments : CommonToolArguments() { put(LanguageFeature.SamConversionPerArgument, LanguageFeature.State.ENABLED) } + if (inlineClasses) { + put(LanguageFeature.InlineClasses, LanguageFeature.State.ENABLED) + } + if (legacySmartCastAfterTry) { put(LanguageFeature.SoundSmartCastsAfterTry, LanguageFeature.State.DISABLED) } diff --git a/compiler/testData/cli/js/jsExtraHelp.out b/compiler/testData/cli/js/jsExtraHelp.out index 5b23723341d..b82f930fc96 100644 --- a/compiler/testData/cli/js/jsExtraHelp.out +++ b/compiler/testData/cli/js/jsExtraHelp.out @@ -22,6 +22,7 @@ where advanced options include: -Xdump-perf= Dump detailed performance statistics to the specified file -Xeffect-system Enable experimental language feature: effect system -Xexperimental= Enable and propagate usages of experimental API for marker annotation with the given fully qualified name + -Xinline-classes Enable experimental inline classes -Xintellij-plugin-root= Path to the kotlin-compiler.jar or directory where IntelliJ configuration files can be found -Xlegacy-smart-cast-after-try Allow var smart casts despite assignment in try block -Xlist-phases List backend phases diff --git a/compiler/testData/cli/jvm/extraHelp.out b/compiler/testData/cli/jvm/extraHelp.out index d68d1f2aa2b..9c16d78818c 100644 --- a/compiler/testData/cli/jvm/extraHelp.out +++ b/compiler/testData/cli/jvm/extraHelp.out @@ -84,6 +84,7 @@ where advanced options include: -Xdump-perf= Dump detailed performance statistics to the specified file -Xeffect-system Enable experimental language feature: effect system -Xexperimental= Enable and propagate usages of experimental API for marker annotation with the given fully qualified name + -Xinline-classes Enable experimental inline classes -Xintellij-plugin-root= Path to the kotlin-compiler.jar or directory where IntelliJ configuration files can be found -Xlegacy-smart-cast-after-try Allow var smart casts despite assignment in try block -Xlist-phases List backend phases