Introduce a compiler X-flag to use the builder inference by default for all calls
^KT-48622 Fixed
This commit is contained in:
+11
@@ -374,6 +374,13 @@ abstract class CommonCompilerArguments : CommonToolArguments() {
|
||||
)
|
||||
var unrestrictedBuilderInference: Boolean by FreezableVar(false)
|
||||
|
||||
@Argument(
|
||||
value = "-Xenable-builder-inference",
|
||||
description = "Use the builder inference by default, for all calls with lambdas which can't be resolved without it.\n" +
|
||||
"The corresponding calls' declarations may not be marked with @BuilderInference."
|
||||
)
|
||||
var enableBuilderInference: Boolean by FreezableVar(false)
|
||||
|
||||
@Argument(
|
||||
value = "-Xself-upper-bound-inference",
|
||||
description = "Support inferring type arguments based on only self upper bounds of the corresponding type parameters"
|
||||
@@ -422,6 +429,10 @@ abstract class CommonCompilerArguments : CommonToolArguments() {
|
||||
put(LanguageFeature.UnrestrictedBuilderInference, LanguageFeature.State.ENABLED)
|
||||
}
|
||||
|
||||
if (enableBuilderInference) {
|
||||
put(LanguageFeature.UseBuilderInferenceWithoutAnnotation, LanguageFeature.State.ENABLED)
|
||||
}
|
||||
|
||||
if (selfUpperBoundInference) {
|
||||
put(LanguageFeature.TypeInferenceOnCallsWithSelfTypes, LanguageFeature.State.ENABLED)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user