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
// expected-warning @+1 {{converting @isolated(any) function of type '@isolated(any) @Sendable () -> ()' to synchronous function type '@Sendable () -> ()' is not allowed; this will be an error in a future Swift language mode}}
// expected-warning @+1 {{converting @isolated(any) function of type '@isolated(any) () -> ()' to synchronous function type '() -> ()' is not allowed; this will be an error in a future Swift language mode}}
_ fn:@escaping@isolated(any)()->Void // expected-note {{parameter 'fn' is implicitly non-sendable}}
130
142
){
131
143
let _:@Sendable()->Void= fn // expected-warning {{using non-sendable parameter 'fn' in a context expecting a '@Sendable' closure}}
144
+
// expected-warning @-1 {{converting @isolated(any) function of type '@isolated(any) () -> Void' to synchronous function type '@Sendable () -> Void' is not allowed; this will be an error in a future Swift language mode}}
145
+
}
146
+
147
+
func nonSendableIsolatedAnyAsyncToSendableSync(
148
+
_ fn:@escaping@isolated(any)()async->Void // expected-note {{parameter 'fn' is implicitly non-sendable}}
149
+
){
150
+
let _:@Sendable()->Void= fn // expected-warning {{using non-sendable parameter 'fn' in a context expecting a '@Sendable' closure}}
151
+
// expected-error @-1 {{invalid conversion from 'async' function of type '@isolated(any) () async -> Void' to synchronous function type '@Sendable () -> Void'}}
152
+
}
153
+
154
+
func nonSendableIsolatedAnyAsyncToSendableAsync(
155
+
_ fn:@escaping@isolated(any)()async->Void // expected-note {{parameter 'fn' is implicitly non-sendable}}
156
+
){
157
+
let _:@Sendable()async->Void= fn // expected-warning {{using non-sendable parameter 'fn' in a context expecting a '@Sendable' closure}}
0 commit comments