Skip to content

Commit aeec3ae

Browse files
committed
Enable new #file in Swift 6 mode
This change was approved for Swift 6 mode in SE-0274/SE-0285.
1 parent 1fbded6 commit aeec3ae

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/Frontend/CompilerInvocation.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,8 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
654654
}
655655

656656
Opts.EnableConcisePoundFile =
657-
Args.hasArg(OPT_enable_experimental_concise_pound_file);
657+
Args.hasArg(OPT_enable_experimental_concise_pound_file) ||
658+
Opts.EffectiveLanguageVersion.isVersionAtLeast(6);
658659
Opts.EnableFuzzyForwardScanTrailingClosureMatching =
659660
Args.hasFlag(OPT_enable_fuzzy_forward_scan_trailing_closure_matching,
660661
OPT_disable_fuzzy_forward_scan_trailing_closure_matching,

test/Sema/diag_mismatched_magic_literals_swift6.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// The future "Swift 6 mode" behavior is staged in behind `-enable-experimental-concise-pound-file`.
22
// RUN: %target-typecheck-verify-swift -enable-experimental-concise-pound-file
33

4+
// And is also available in Swift 6 mode on asserts compilers.
5+
// RUN: %target-typecheck-verify-swift -swift-version 6
6+
// REQUIRES: asserts
7+
48
func callee(file: String = #file) {} // expected-note {{'file' declared here}}
59
func callee(fileID: String = #fileID) {} // expected-note {{'fileID' declared here}}
610
func callee(filePath: String = #filePath) {} // expected-note 2 {{'filePath' declared here}}

0 commit comments

Comments
 (0)