Skip to content

Commit c3ef34b

Browse files
committed
Add experimental feature flag for Implement 'some'
1 parent 1b71154 commit c3ef34b

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

include/swift/Basic/Features.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ EXPERIMENTAL_FEATURE(ParserValidation)
138138
/// Swift Swift parser.
139139
EXPERIMENTAL_FEATURE(ParserSequenceFolding)
140140

141+
/// Enables implicit some while also enabling existential `any`
142+
EXPERIMENTAL_FEATURE(ImplicitSome)
143+
141144
#undef EXPERIMENTAL_FEATURE
142145
#undef UPCOMING_FEATURE
143146
#undef SUPPRESSIBLE_LANGUAGE_FEATURE

include/swift/Option/FrontendOptions.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,10 @@ def enable_experimental_associated_type_inference :
579579
Flag<["-"], "enable-experimental-associated-type-inference">,
580580
HelpText<"Enable experimental associated type inference via type witness systems">;
581581

582+
def enable_experimental_implicit_some :
583+
Flag<["-"], "enable-experimental-implicit-some">,
584+
HelpText<"Enable experimental implicit some">;
585+
582586
def disable_availability_checking : Flag<["-"],
583587
"disable-availability-checking">,
584588
HelpText<"Disable checking for potentially unavailable APIs">;

lib/AST/ASTPrinter.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3045,6 +3045,10 @@ static bool usesFeatureExistentialAny(Decl *decl) {
30453045
return false;
30463046
}
30473047

3048+
static bool usesFeatureImplicitSome(Decl *decl) {
3049+
return false;
3050+
}
3051+
30483052
static bool usesFeatureForwardTrailingClosures(Decl *decl) {
30493053
return false;
30503054
}

lib/Frontend/CompilerInvocation.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,9 +684,12 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
684684
Opts.Features.insert(Feature::ForwardModeDifferentiation);
685685
if (Args.hasArg(OPT_enable_experimental_additive_arithmetic_derivation))
686686
Opts.Features.insert(Feature::AdditiveArithmeticDerivedConformances);
687-
688687
if (Args.hasArg(OPT_enable_experimental_opaque_type_erasure))
689688
Opts.Features.insert(Feature::OpaqueTypeErasure);
689+
if (Args.hasArg(OPT_enable_experimental_variadic_generics)){
690+
Opts.Features.insert(Feature::ImplicitSome);
691+
Opts.Features.insert(Feature::ExistentialAny);
692+
}
690693

691694
Opts.EnableAppExtensionRestrictions |= Args.hasArg(OPT_enable_app_extension);
692695

0 commit comments

Comments
 (0)