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
[rbi] When translating a Store, make sure to require src even if the value being stored is Sendable
This is important to ensure that we require the base of src if the src is
non-Sendable (e.x.: a non-Sendable box).
rdar://163322459
#85107
(cherry picked from commit 3f180c6)
Task{ // expected-warning {{sending value of non-Sendable type '() async -> ()' risks causing data races}}
2027
+
// expected-note @-1 {{Passing value of non-Sendable type '() async -> ()' as a 'sending' argument to initializer 'init(name:priority:operation:)' risks causing races in between local and caller code}}
2028
+
result = t
2029
+
}
2030
+
useValue(result) // expected-note {{access can happen concurrently}}
2031
+
}
2032
+
2033
+
func test2(){
2034
+
varresult:Any=0
2035
+
Task{ // expected-warning {{sending value of non-Sendable type '() async -> ()' risks causing data races}}
2036
+
// expected-note @-1 {{Passing value of non-Sendable type '() async -> ()' as a 'sending' argument to initializer 'init(name:priority:operation:)' risks causing races in between local and caller code}}
2037
+
result =0
2038
+
}
2039
+
useValue(result) // expected-note {{access can happen concurrently}}
Task{ // expected-warning {{sending value of non-Sendable type '() async -> ()' risks causing data races}}
2049
+
// expected-note @-1 {{Passing value of non-Sendable type '() async -> ()' as a 'sending' argument to initializer 'init(name:priority:operation:)' risks causing races in between local and caller code}}
2050
+
result = type.init()
2051
+
}
2052
+
useValue(result) // expected-note {{access can happen concurrently}}
0 commit comments