(Cross-posted from the feedback FB18050331)
The Combine Subscriber protocol does not currently conform to SendableMetaType.
This lack of conformance makes it impossible to use it without compiler errors or warnings similar to "Capture of non-sendable type 'SomeSubscriber.Type' in an isolated closure".
Indeed, the subscriber is supposed to be notified of published values in whatever isolation a Publisher or Subscription is working in (frequently, nonisolated). Hence a Subscriber type can not support isolated conformances. This is by design of pub/sub in Combine, where subscribers can not specify their preferred isolation. Hence a Subscriber type can not support isolated conformance introduced in SE-0470.
Please fix this by adding SendableMetaType conformance to Subscriber:
-public protocol Subscriber<Input, Failure> : CustomCombineIdentifierConvertible {
+public protocol Subscriber<Input, Failure> : CustomCombineIdentifierConvertible, SendableMetaType {
Possibly related to Library protocols can not overtake the default isolation of the importing module · Issue #82249 · swiftlang/swift · GitHub (conforming to Subscriber
should probably imply nonisolated
, even for subscribers defined in modules that are MainActor-isolated by default).