Skip to content

Commit 051c7d2

Browse files
committed
Fix merge conflict issue.
1 parent 0f9fcfd commit 051c7d2

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

test/Concurrency/transfernonsendable_asynclet.swift

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,15 @@ struct TwoFieldKlassBox {
5858
var k2 = NonSendableKlass()
5959
}
6060

61+
actor CustomActorInstance {}
62+
63+
@globalActor
64+
struct CustomActor {
65+
static let shared = CustomActorInstance()
66+
}
67+
68+
@CustomActor func transferToCustomInt<T>(_ t: T) async -> Int { 5 }
69+
6170
/////////////////////////////////////
6271
// MARK: Async Let Let Actor Tests //
6372
/////////////////////////////////////
@@ -279,7 +288,9 @@ func asyncLet_Let_ActorIsolated_CallBuriedInOtherExpr3() async {
279288
func asyncLet_Let_ActorIsolated_CallBuriedInOtherExpr4() async {
280289
let x = NonSendableKlass()
281290

282-
async let y = useValue(transferToMainInt(x) + transferToMainInt(x))
291+
async let y = useValue(transferToMainInt(x) + transferToMainInt(x)) // expected-warning {{sending 'x' risks causing data races}}
292+
// expected-note @-1 {{sending 'x' to main actor-isolated global function 'transferToMainInt' risks causing data races between main actor-isolated and local nonisolated uses}}
293+
// expected-note @-2:67 {{access can happen concurrently}}
283294

284295
let _ = await y
285296
}
@@ -292,7 +303,7 @@ func asyncLet_Let_ActorIsolated_CallBuriedInOtherExpr5() async {
292303
async let y = useValue(transferToMainInt(x) + transferToCustomInt(x))
293304
// expected-warning @-1 {{sending 'x' risks causing data races}}
294305
// expected-note @-2 {{sending 'x' to main actor-isolated global function 'transferToMainInt' risks causing data races between main actor-isolated and local nonisolated uses}}
295-
// expected-note @-3:49 {{access can happen concurrently}}
306+
// expected-note @-3:69 {{access can happen concurrently}}
296307

297308
let _ = await y
298309
}

0 commit comments

Comments
 (0)