Skip to content

Commit 2d63307

Browse files
committed
[Diagnostics] Clarify the wording of error_in_future_swift_version.
1 parent f1e14f8 commit 2d63307

File tree

71 files changed

+334
-334
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+334
-334
lines changed

include/swift/AST/DiagnosticsCommon.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ NOTE(brace_stmt_suggest_do,none,
4545
"did you mean to use a 'do' statement?", ())
4646

4747
WARNING(error_in_future_swift_version,none,
48-
"%0; this is an error in Swift %1",
48+
"%0; this is an error in the Swift %1 language mode",
4949
(DiagnosticInfo *, unsigned))
5050

5151
// Generic disambiguation

include/swift/AST/DiagnosticsSema.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6802,7 +6802,7 @@ WARNING(inlinable_decl_ref_from_hidden_module_warn,
68026802
none, "%kind0 cannot be used in " FRAGILE_FUNC_KIND "1 "
68036803
"because %select{<<ERROR>>|<<ERROR>>|<<ERROR>>|<<ERROR>>|"
68046804
"%2 was not imported by this file}3"
6805-
"; this is an error in Swift 6",
6805+
"; this is an error in the Swift 6 language mode",
68066806
(const ValueDecl *, unsigned, Identifier, unsigned))
68076807

68086808
ERROR(inlinable_typealias_desugars_to_type_from_hidden_module,

test/ClangImporter/objc_async.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ class BarFrame: PictureFrame {
298298
@available(SwiftStdlib 5.5, *)
299299
@SomeGlobalActor
300300
class BazFrame: NotIsolatedPictureFrame {
301-
// expected-warning@-1 {{global actor 'SomeGlobalActor'-isolated class 'BazFrame' has different actor isolation from nonisolated superclass 'NotIsolatedPictureFrame'; this is an error in Swift 6}}
301+
// expected-warning@-1 {{global actor 'SomeGlobalActor'-isolated class 'BazFrame' has different actor isolation from nonisolated superclass 'NotIsolatedPictureFrame'; this is an error in the Swift 6 language mode}}
302302
init() {
303303
super.init(size: 0)
304304
}
@@ -365,7 +365,7 @@ func testSender(
365365

366366
sender.sendAnyArray([sendableObject])
367367
sender.sendAnyArray([nonSendableObject])
368-
// expected-warning@-1 {{conformance of 'NonSendableClass' to 'Sendable' is unavailable; this is an error in Swift 6}}
368+
// expected-warning@-1 {{conformance of 'NonSendableClass' to 'Sendable' is unavailable; this is an error in the Swift 6 language mode}}
369369

370370
sender.sendGeneric(sendableGeneric) // no warning
371371

@@ -393,7 +393,7 @@ extension SomeWrapper: Sendable where T: Sendable {}
393393
func makeCall(slowServer: SlowServer) {
394394
slowServer.doSomethingSlow("churn butter") { (_ : Int) in
395395
let _ = self.isolatedThing
396-
// expected-warning@-1 {{main actor-isolated property 'isolatedThing' can not be referenced from a Sendable closure; this is an error in Swift 6}}
396+
// expected-warning@-1 {{main actor-isolated property 'isolatedThing' can not be referenced from a Sendable closure; this is an error in the Swift 6 language mode}}
397397
}
398398
}
399399
}

test/ClangImporter/objc_async_conformance.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class SelectorBothAsync2: NSObject, SelectorBothAsyncProto {
8787
func hello() async -> Bool // expected-note {{method 'hello()' declared here}}
8888

8989
@objc(helloWithCompletion:)
90-
func hello(completion: @escaping (Bool) -> Void) // expected-warning {{method 'hello(completion:)' with Objective-C selector 'helloWithCompletion:' conflicts with method 'hello()' with the same Objective-C selector; this is an error in Swift 6}}
90+
func hello(completion: @escaping (Bool) -> Void) // expected-warning {{method 'hello(completion:)' with Objective-C selector 'helloWithCompletion:' conflicts with method 'hello()' with the same Objective-C selector; this is an error in the Swift 6 language mode}}
9191
}
9292

9393
// additional coverage for situation like C4, where the method names don't

test/ClangImporter/objc_bridging_custom.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ protocol TestProto {
161161

162162
@objc optional subscript(a a: Refrigerator) -> Refrigerator? { get } // expected-note 2 {{here}} {{none}}
163163
@objc optional subscript(generic a: ManufacturerInfo<NSString>) -> ManufacturerInfo<NSString>? { get } // expected-note {{here}} {{none}}
164-
// expected-warning@-1 {{subscript getter with Objective-C selector 'objectForKeyedSubscript:' conflicts with previous declaration with the same Objective-C selector; this is an error in Swift 6}}
164+
// expected-warning@-1 {{subscript getter with Objective-C selector 'objectForKeyedSubscript:' conflicts with previous declaration with the same Objective-C selector; this is an error in the Swift 6 language mode}}
165165

166166
@objc optional var prop: Refrigerator? { get } // expected-note {{here}} {{none}}
167167
@objc optional var propGeneric: ManufacturerInfo<NSString>? { get } // expected-note {{here}} {{none}}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
struct Foo {
2-
static let member = Bar() // expected-complete-warning {{static property 'member' is not concurrency-safe because it is not either conforming to 'Sendable' or isolated to a global actor; this is an error in Swift 6}}
2+
static let member = Bar() // expected-complete-warning {{static property 'member' is not concurrency-safe because it is not either conforming to 'Sendable' or isolated to a global actor; this is an error in the Swift 6 language mode}}
33
}

test/Concurrency/actor_inout_isolation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ actor ProtectDictionary {
318318

319319
func invalid() async {
320320
await dict[0].mutate()
321-
// expected-warning@-1 {{cannot call mutating async function 'mutate()' on actor-isolated property 'dict'; this is an error in Swift 6}}
321+
// expected-warning@-1 {{cannot call mutating async function 'mutate()' on actor-isolated property 'dict'; this is an error in the Swift 6 language mode}}
322322
// expected-targeted-complete-warning@-2 {{passing argument of non-sendable type 'inout Optional<Int>' outside of actor-isolated context may introduce data races}}
323323
}
324324
}

0 commit comments

Comments
 (0)