the.bay.news

Async let capture list

Swift Forums
Async let capture list
I'm having an issue capturing a sendable type in an async let closure. struct NonSendable { var description: String init(description: String) { self.description = description } } var nonSendables: [NonSendable] = [] let aTask = Task { [sendables = nonSendables.map(\.description)] in for something in sendables { // this is fine } } async let asyncLet = { [sendables = nonSendables.map(\.description)] in for something in sendables { // Sending 'nonSendables' into async let risks causin...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.