Quick / Nimble

A Matcher Framework for Swift and Objective-C
https://quick.github.io/Nimble/documentation/nimble/
Apache License 2.0
4.8k stars 596 forks source link

Make AsyncPredicate Sendable, constrain it to Sendable types #1072

Closed younata closed 1 year ago

younata commented 1 year ago

As part of concurrency checking, AsyncPredicate needs to be Sendable. Part of that is that the closure needs to be Sendable and AsyncPredicate needs to be constrained to only Sendable types.

As part of interop with AsyncPredicate, Predicate needs to be Sendable. Though, it's ok to only make Predicate Sendable when the type it works with is Sendable (that is, we have: extension Predicate: Sendable where T: Sendable {}).

This also fixes compiler errors in Nimble associated with making the closures passed to Predicate Sendable.