Add -Xeffect-system CLI argument which enables Effect System

This commit is contained in:
Dmitry Savvinov
2017-11-15 20:54:26 +03:00
parent 44d232a83c
commit 440b6d9934
4 changed files with 14 additions and 0 deletions
@@ -118,6 +118,12 @@ abstract class CommonCompilerArguments : CommonToolArguments() {
)
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> {
return HashMap<AnalysisFlag<*>, Any>().apply {
put(AnalysisFlag.skipMetadataVersionCheck, skipMetadataVersionCheck)
@@ -212,6 +212,12 @@ public abstract class CLICompiler<A extends CommonCompilerArguments> extends CLI
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);
CommonConfigurationKeysKt.setLanguageVersionSettings(configuration, new LanguageVersionSettingsImpl(
+1
View File
@@ -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
-Xcoroutines={enable|warn|error}
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
-Xlegacy-smart-cast-after-try Allow var smart casts despite assignment in try block
-Xmulti-platform Enable experimental language support for multi-platform projects
+1
View File
@@ -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
-Xcoroutines={enable|warn|error}
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
-Xlegacy-smart-cast-after-try Allow var smart casts despite assignment in try block
-Xmulti-platform Enable experimental language support for multi-platform projects