Add -Xeffect-system CLI argument which enables Effect System
This commit is contained in:
+6
@@ -118,6 +118,12 @@ abstract class CommonCompilerArguments : CommonToolArguments() {
|
|||||||
)
|
)
|
||||||
var legacySmartCastAfterTry by FreezableVar(false)
|
var legacySmartCastAfterTry by FreezableVar(false)
|
||||||
|
|
||||||
|
@Argument(
|
||||||
|
value = "-Xeffect-system",
|
||||||
|
description = "Enable experimental language feature: effect system"
|
||||||
|
)
|
||||||
|
var effectSystem: Boolean by FreezableVar(false)
|
||||||
|
|
||||||
open fun configureAnalysisFlags(collector: MessageCollector): MutableMap<AnalysisFlag<*>, Any> {
|
open fun configureAnalysisFlags(collector: MessageCollector): MutableMap<AnalysisFlag<*>, Any> {
|
||||||
return HashMap<AnalysisFlag<*>, Any>().apply {
|
return HashMap<AnalysisFlag<*>, Any>().apply {
|
||||||
put(AnalysisFlag.skipMetadataVersionCheck, skipMetadataVersionCheck)
|
put(AnalysisFlag.skipMetadataVersionCheck, skipMetadataVersionCheck)
|
||||||
|
|||||||
@@ -212,6 +212,12 @@ public abstract class CLICompiler<A extends CommonCompilerArguments> extends CLI
|
|||||||
extraLanguageFeatures.put(LanguageFeature.SoundSmartCastsAfterTry, LanguageFeature.State.DISABLED);
|
extraLanguageFeatures.put(LanguageFeature.SoundSmartCastsAfterTry, LanguageFeature.State.DISABLED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (arguments.getEffectSystem()) {
|
||||||
|
extraLanguageFeatures.put(LanguageFeature.CallsInPlaceEffect, LanguageFeature.State.ENABLED);
|
||||||
|
extraLanguageFeatures.put(LanguageFeature.ReturnsEffect, LanguageFeature.State.ENABLED);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
setupPlatformSpecificLanguageFeatureSettings(extraLanguageFeatures, arguments);
|
setupPlatformSpecificLanguageFeatureSettings(extraLanguageFeatures, arguments);
|
||||||
|
|
||||||
CommonConfigurationKeysKt.setLanguageVersionSettings(configuration, new LanguageVersionSettingsImpl(
|
CommonConfigurationKeysKt.setLanguageVersionSettings(configuration, new LanguageVersionSettingsImpl(
|
||||||
|
|||||||
+1
@@ -6,6 +6,7 @@ where advanced options include:
|
|||||||
-Xallow-kotlin-package Allow compiling code in package 'kotlin' and allow not requiring kotlin.stdlib in module-info
|
-Xallow-kotlin-package Allow compiling code in package 'kotlin' and allow not requiring kotlin.stdlib in module-info
|
||||||
-Xcoroutines={enable|warn|error}
|
-Xcoroutines={enable|warn|error}
|
||||||
Enable coroutines or report warnings or errors on declarations and use sites of 'suspend' modifier
|
Enable coroutines or report warnings or errors on declarations and use sites of 'suspend' modifier
|
||||||
|
-Xeffect-system Enable experimental language feature: effect system
|
||||||
-Xintellij-plugin-root=<path> Path to the kotlin-compiler.jar or directory where IntelliJ configuration files can be found
|
-Xintellij-plugin-root=<path> 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
|
-Xlegacy-smart-cast-after-try Allow var smart casts despite assignment in try block
|
||||||
-Xmulti-platform Enable experimental language support for multi-platform projects
|
-Xmulti-platform Enable experimental language support for multi-platform projects
|
||||||
|
|||||||
+1
@@ -33,6 +33,7 @@ where advanced options include:
|
|||||||
-Xallow-kotlin-package Allow compiling code in package 'kotlin' and allow not requiring kotlin.stdlib in module-info
|
-Xallow-kotlin-package Allow compiling code in package 'kotlin' and allow not requiring kotlin.stdlib in module-info
|
||||||
-Xcoroutines={enable|warn|error}
|
-Xcoroutines={enable|warn|error}
|
||||||
Enable coroutines or report warnings or errors on declarations and use sites of 'suspend' modifier
|
Enable coroutines or report warnings or errors on declarations and use sites of 'suspend' modifier
|
||||||
|
-Xeffect-system Enable experimental language feature: effect system
|
||||||
-Xintellij-plugin-root=<path> Path to the kotlin-compiler.jar or directory where IntelliJ configuration files can be found
|
-Xintellij-plugin-root=<path> 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
|
-Xlegacy-smart-cast-after-try Allow var smart casts despite assignment in try block
|
||||||
-Xmulti-platform Enable experimental language support for multi-platform projects
|
-Xmulti-platform Enable experimental language support for multi-platform projects
|
||||||
|
|||||||
Reference in New Issue
Block a user