Add compiler key to enable new inference
This commit is contained in:
+7
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010-2016 JetBrains s.r.o.
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -106,6 +106,12 @@ abstract class CommonCompilerArguments : CommonToolArguments() {
|
|||||||
)
|
)
|
||||||
var coroutinesState: String? by FreezableVar(WARN)
|
var coroutinesState: String? by FreezableVar(WARN)
|
||||||
|
|
||||||
|
@Argument(
|
||||||
|
value = "-Xnew-inference",
|
||||||
|
description = "Enable new experimental generic type inference algorithm"
|
||||||
|
)
|
||||||
|
var newInference: 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)
|
||||||
|
|||||||
@@ -204,6 +204,10 @@ public abstract class CLICompiler<A extends CommonCompilerArguments> extends CLI
|
|||||||
extraLanguageFeatures.put(LanguageFeature.Coroutines, coroutinesState);
|
extraLanguageFeatures.put(LanguageFeature.Coroutines, coroutinesState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (arguments.getNewInference()) {
|
||||||
|
extraLanguageFeatures.put(LanguageFeature.NewInference, LanguageFeature.State.ENABLED);
|
||||||
|
}
|
||||||
|
|
||||||
setupPlatformSpecificLanguageFeatureSettings(extraLanguageFeatures, arguments);
|
setupPlatformSpecificLanguageFeatureSettings(extraLanguageFeatures, arguments);
|
||||||
|
|
||||||
CommonConfigurationKeysKt.setLanguageVersionSettings(configuration, new LanguageVersionSettingsImpl(
|
CommonConfigurationKeysKt.setLanguageVersionSettings(configuration, new LanguageVersionSettingsImpl(
|
||||||
|
|||||||
+1
@@ -8,6 +8,7 @@ where advanced options include:
|
|||||||
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
|
||||||
-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
|
||||||
-Xmulti-platform Enable experimental language support for multi-platform projects
|
-Xmulti-platform Enable experimental language support for multi-platform projects
|
||||||
|
-Xnew-inference Enable new experimental generic type inference algorithm
|
||||||
-Xno-check-actual Do not check presence of 'actual' modifier in multi-platform projects
|
-Xno-check-actual Do not check presence of 'actual' modifier in multi-platform projects
|
||||||
-Xno-inline Disable method inlining
|
-Xno-inline Disable method inlining
|
||||||
-Xplugin=<path> Load plugins from the given classpath
|
-Xplugin=<path> Load plugins from the given classpath
|
||||||
|
|||||||
+1
@@ -35,6 +35,7 @@ where advanced options include:
|
|||||||
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
|
||||||
-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
|
||||||
-Xmulti-platform Enable experimental language support for multi-platform projects
|
-Xmulti-platform Enable experimental language support for multi-platform projects
|
||||||
|
-Xnew-inference Enable new experimental generic type inference algorithm
|
||||||
-Xno-check-actual Do not check presence of 'actual' modifier in multi-platform projects
|
-Xno-check-actual Do not check presence of 'actual' modifier in multi-platform projects
|
||||||
-Xno-inline Disable method inlining
|
-Xno-inline Disable method inlining
|
||||||
-Xplugin=<path> Load plugins from the given classpath
|
-Xplugin=<path> Load plugins from the given classpath
|
||||||
|
|||||||
Reference in New Issue
Block a user