Skip to content

Commit 7cdda6d

Browse files
committed
[FrontendOptions] Add a frontend flag -enable-explicit-existential-types
to enable the 'any' keyword.
1 parent 6a34f04 commit 7cdda6d

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

include/swift/Basic/LangOptions.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,10 @@ namespace swift {
310310
/// `func f() -> <T> T`.
311311
bool EnableExperimentalNamedOpaqueTypes = false;
312312

313+
/// Enable support for explicit existential types via the \c any
314+
/// keyword.
315+
bool EnableExplicitExistentialTypes = false;
316+
313317
/// Enable experimental flow-sensitive concurrent captures.
314318
bool EnableExperimentalFlowSensitiveConcurrentCaptures = false;
315319

include/swift/Option/FrontendOptions.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,10 @@ def enable_experimental_structural_opaque_types :
476476
Flag<["-"], "enable-experimental-structural-opaque-types">,
477477
HelpText<"Enable experimental support for structural opaque result types">;
478478

479+
def enable_explicit_existential_types :
480+
Flag<["-"], "enable-explicit-existential-types">,
481+
HelpText<"Enable experimental support for explicit existential types">;
482+
479483
def enable_deserialization_recovery :
480484
Flag<["-"], "enable-deserialization-recovery">,
481485
HelpText<"Attempt to recover from missing xrefs (etc) in swiftmodules">;

lib/Frontend/CompilerInvocation.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,9 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
438438
Opts.EnableExperimentalNamedOpaqueTypes |=
439439
Args.hasArg(OPT_enable_experimental_named_opaque_types);
440440

441+
Opts.EnableExplicitExistentialTypes |=
442+
Args.hasArg(OPT_enable_explicit_existential_types);
443+
441444
Opts.EnableExperimentalDistributed |=
442445
Args.hasArg(OPT_enable_experimental_distributed);
443446

0 commit comments

Comments
 (0)