objc2 icon indicating copy to clipboard operation
objc2 copied to clipboard

`Send + Sync` / `@Sendable` blocks

Open madsmtm opened this issue 5 months ago • 0 comments

Clang has bindings for Swift's @Sendable protocol on blocks (with the default being non-sendable), we should add support for this into block2.

Basic idea is to allow Block<dyn Fn() + Send + Sync>, though since we don't have custom coercions yet, it likely won't be as pretty as through Deref.

Notes in this comment on whether we should have both Send + Sync, or if we can get away with one of those bounds.

madsmtm avatar Feb 02 '24 13:02 madsmtm