Skip to content

Commit 5f86fe6

Browse files
committed
Add feature flag for module selector
# Conflicts: # test/NameLookup/module_selector.swift
1 parent 59f1e28 commit 5f86fe6

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

include/swift/Basic/LangOptions.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,9 @@ namespace swift {
292292
/// language modes.
293293
bool WarnConcurrency = false;
294294

295+
/// Enable experimental 'Module::name' syntax.
296+
bool EnableExperimentalModuleSelector = false;
297+
295298
/// Enable experimental #assert feature.
296299
bool EnableExperimentalStaticAssert = false;
297300

include/swift/Option/FrontendOptions.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,10 @@ def suppress_static_exclusivity_swap : Flag<["-"], "suppress-static-exclusivity-
427427
def enable_sil_opaque_values : Flag<["-"], "enable-sil-opaque-values">,
428428
HelpText<"Enable SIL Opaque Values">;
429429

430+
def enable_experimental_module_selector :
431+
Flag<["-"], "enable-experimental-module-selector">,
432+
HelpText<"Enable experimental 'Module::name' syntax">;
433+
430434
def enable_experimental_static_assert :
431435
Flag<["-"], "enable-experimental-static-assert">,
432436
HelpText<"Enable experimental #assert">;

lib/Frontend/CompilerInvocation.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,9 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
416416
Opts.DiagnosticsEditorMode |= Args.hasArg(OPT_diagnostics_editor_mode,
417417
OPT_serialize_diagnostics_path);
418418

419+
Opts.EnableExperimentalModuleSelector |=
420+
Args.hasArg(OPT_enable_experimental_module_selector);
421+
419422
Opts.EnableExperimentalStaticAssert |=
420423
Args.hasArg(OPT_enable_experimental_static_assert);
421424

test/NameLookup/module_selector.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// RUN: %target-typecheck-verify-swift -enable-experimental-module-selector %s

0 commit comments

Comments
 (0)