You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/Concurrency/sendnonsendable_basic.swift
+2-5Lines changed: 2 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -33,11 +33,8 @@ func useValue<T>(_ x: T) {}
33
33
////////////////////////////
34
34
35
35
extensionActor{
36
-
func noWarningIfCallingGetter()async{
37
-
// We should emit an error here since self is an actor which is non
38
-
// sendable, so we could be accessing isolated information from a part of
39
-
// the actor.
40
-
awaitself.klass.asyncCall()
36
+
func warningIfCallingGetter()async{
37
+
awaitself.klass.asyncCall() // expected-sns-warning {{call site passes `self` or a non-sendable argument of this function to another thread, potentially yielding a race with the caller}}
41
38
// expected-complete-warning @-1 {{passing argument of non-sendable type 'NonSendableKlass' outside of actor-isolated context may introduce data races}}
0 commit comments