Skip to content

Commit b81f6bb

Browse files
committed
Fix an error message due to a difference in Task.detached from 6.2 and main.
1 parent 4ccb39e commit b81f6bb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/Concurrency/transfernonsendable_nonisolatedunsafe.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,7 +1008,7 @@ func closureTests() async {
10081008
func testWithTaskDetached() async {
10091009
let x1 = NonSendableKlass()
10101010
Task.detached { _ = x1 } // expected-warning {{sending value of non-Sendable type '() async -> ()' risks causing data races}}
1011-
// expected-note @-1 {{Passing value of non-Sendable type '() async -> ()' as a 'sending' argument to static method 'detached(priority:operation:)' risks causing races in between local and caller code}}
1011+
// expected-note @-1 {{Passing value of non-Sendable type '() async -> ()' as a 'sending' argument to static method 'detached(name:priority:operation:)' risks causing races in between local and caller code}}
10121012
Task.detached { _ = x1 } // expected-note {{access can happen concurrently}}
10131013

10141014
nonisolated(unsafe) let x2 = NonSendableKlass()
@@ -1023,7 +1023,7 @@ func closureTests() async {
10231023
nonisolated(unsafe) let x4a = NonSendableKlass()
10241024
let x4b = NonSendableKlass()
10251025
Task.detached { _ = x4a; _ = x4b } // expected-warning {{sending value of non-Sendable type '() async -> ()' risks causing data races}}
1026-
// expected-note @-1 {{Passing value of non-Sendable type '() async -> ()' as a 'sending' argument to static method 'detached(priority:operation:)' risks causing races in between local and caller code}}
1026+
// expected-note @-1 {{Passing value of non-Sendable type '() async -> ()' as a 'sending' argument to static method 'detached(name:priority:operation:)' risks causing races in between local and caller code}}
10271027
Task.detached { _ = x4a; _ = x4b } // expected-note {{access can happen concurrently}}
10281028
}
10291029

0 commit comments

Comments
 (0)