Skip to content

Commit 327a508

Browse files
committed
Frontend: Add -enable-parametrized-protocol-types flag
1 parent 3165ea5 commit 327a508

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
@@ -317,6 +317,10 @@ namespace swift {
317317
/// keyword.
318318
bool EnableExplicitExistentialTypes = true;
319319

320+
/// Enable support for protocol types parametrized by primary
321+
/// associated type.
322+
bool EnableParametrizedProtocolTypes = false;
323+
320324
/// Enable experimental flow-sensitive concurrent captures.
321325
bool EnableExperimentalFlowSensitiveConcurrentCaptures = false;
322326

include/swift/Option/FrontendOptions.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,10 @@ def enable_explicit_existential_types :
506506
Flag<["-"], "enable-explicit-existential-types">,
507507
HelpText<"Enable experimental support for explicit existential types">;
508508

509+
def enable_parametrized_protocol_types :
510+
Flag<["-"], "enable-parametrized-protocol-types">,
511+
HelpText<"Enable experimental support for primary associated types and parametrized protocols">;
512+
509513
def enable_deserialization_recovery :
510514
Flag<["-"], "enable-deserialization-recovery">,
511515
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
@@ -448,6 +448,9 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
448448
Opts.EnableExplicitExistentialTypes |=
449449
Args.hasArg(OPT_enable_explicit_existential_types);
450450

451+
Opts.EnableParametrizedProtocolTypes |=
452+
Args.hasArg(OPT_enable_parametrized_protocol_types);
453+
451454
Opts.EnableExperimentalDistributed |=
452455
Args.hasArg(OPT_enable_experimental_distributed);
453456

0 commit comments

Comments
 (0)