hborla
(Holly Borla)
23
Did you build with -enable-experimental-feature OptionalIsolatedParameters? I tried to build this with -enable-experimental-feature OptionalIsolatedParameters -strict-concurrency=complete on main and I do not see any concurrency warnings:
class NotSendable {}
@MainActor
class ActorIsolatedType {
func foo() async {
await (1...3).forEachAsync(MainActor.shared) { _ in
await bar(NotSendable())
}
}
func bar(_: NotSendable) async {}
}
extension Sequence where Element: Sendable {
func forEachAsync(_: isolated Actor, _ operation: (Element) async -> Void) async {
for element in self {
await operation(element)
}
}
}
1 Like
Big +1. I’m very happy to see the continued iteration of making concurrency work for all the use cases out there.
Will there be a separate proposal to adopt this for AsyncSequence?
hborla
(Holly Borla)
26
3 Likes
xwu
(Xiaodi Wu)
27
Thank you all for your review comments. This proposal has been accepted by the language steering group.
1 Like