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
Task{ // expected-ni-warning {{sending value of non-Sendable type '() async -> ()' risks causing data races}}
2033
+
// expected-ni-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}}
2034
+
// expected-ni-ns-warning @-2 {{sending value of non-Sendable type '@concurrent () async -> ()' risks causing data races}}
2035
+
// expected-ni-ns-note @-3 {{Passing value of non-Sendable type '@concurrent () async -> ()' as a 'sending' argument to initializer 'init(name:priority:operation:)' risks causing races in between local and caller code}}
2036
+
result = t
2037
+
}
2038
+
useValue(result) // expected-note {{access can happen concurrently}}
2039
+
}
2040
+
2041
+
func test2(){
2042
+
varresult:Any=0
2043
+
Task{ // expected-ni-warning {{sending value of non-Sendable type '() async -> ()' risks causing data races}}
2044
+
// expected-ni-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}}
2045
+
// expected-ni-ns-warning @-2 {{sending value of non-Sendable type '@concurrent () async -> ()' risks causing data races}}
2046
+
// expected-ni-ns-note @-3 {{Passing value of non-Sendable type '@concurrent () async -> ()' as a 'sending' argument to initializer 'init(name:priority:operation:)' risks causing races in between local and caller code}}
2047
+
result =0
2048
+
}
2049
+
useValue(result) // expected-note {{access can happen concurrently}}
Task{ // expected-ni-warning {{sending value of non-Sendable type '() async -> ()' risks causing data races}}
2059
+
// expected-ni-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}}
2060
+
// expected-ni-ns-warning @-2 {{sending value of non-Sendable type '@concurrent () async -> ()' risks causing data races}}
2061
+
// expected-ni-ns-note @-3 {{Passing value of non-Sendable type '@concurrent () async -> ()' as a 'sending' argument to initializer 'init(name:priority:operation:)' risks causing races in between local and caller code}}
2062
+
result = type.init()
2063
+
}
2064
+
useValue(result) // expected-note {{access can happen concurrently}}
0 commit comments