Add experimental feature flag for Implement 'some'

This commit is contained in:
Angela Laar
2022-08-09 14:35:31 -07:00
parent 1b71154869
commit c3ef34b080
4 changed files with 15 additions and 1 deletions

View File

@@ -138,6 +138,9 @@ EXPERIMENTAL_FEATURE(ParserValidation)
/// Swift Swift parser.
EXPERIMENTAL_FEATURE(ParserSequenceFolding)
/// Enables implicit some while also enabling existential `any`
EXPERIMENTAL_FEATURE(ImplicitSome)
#undef EXPERIMENTAL_FEATURE
#undef UPCOMING_FEATURE
#undef SUPPRESSIBLE_LANGUAGE_FEATURE

View File

@@ -579,6 +579,10 @@ def enable_experimental_associated_type_inference :
Flag<["-"], "enable-experimental-associated-type-inference">,
HelpText<"Enable experimental associated type inference via type witness systems">;
def enable_experimental_implicit_some :
Flag<["-"], "enable-experimental-implicit-some">,
HelpText<"Enable experimental implicit some">;
def disable_availability_checking : Flag<["-"],
"disable-availability-checking">,
HelpText<"Disable checking for potentially unavailable APIs">;

View File

@@ -3045,6 +3045,10 @@ static bool usesFeatureExistentialAny(Decl *decl) {
return false;
}
static bool usesFeatureImplicitSome(Decl *decl) {
return false;
}
static bool usesFeatureForwardTrailingClosures(Decl *decl) {
return false;
}

View File

@@ -684,9 +684,12 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
Opts.Features.insert(Feature::ForwardModeDifferentiation);
if (Args.hasArg(OPT_enable_experimental_additive_arithmetic_derivation))
Opts.Features.insert(Feature::AdditiveArithmeticDerivedConformances);
if (Args.hasArg(OPT_enable_experimental_opaque_type_erasure))
Opts.Features.insert(Feature::OpaqueTypeErasure);
if (Args.hasArg(OPT_enable_experimental_variadic_generics)){
Opts.Features.insert(Feature::ImplicitSome);
Opts.Features.insert(Feature::ExistentialAny);
}
Opts.EnableAppExtensionRestrictions |= Args.hasArg(OPT_enable_app_extension);