Skip to content

Conversation

@kcede
Copy link

@kcede kcede commented Oct 16, 2025

Description

In the SDK that ships with Xcode, these types are marked as Sendable, which causes source compatibility issues.

Adds missing Sendable conformance to the following types:

  • DispatchQueue.Attributes
  • DispatchQueue.GlobalQueuePriority
  • DispatchQueue.AutoreleaseFrequency
  • DispatchWorkItemFlags
  • DispatchIO.StreamType
  • DispatchIO.CloseFlags
  • DispatchIO.IntervalFlags
  • DispatchData
  • DispatchData.Deallocator
  • DispatchDataIterator

Related issues: #779, #910

Reproduction

import Dispatch

@main
struct swift_dispatch_sendable {
    static func main() async {
        let sendables: [Sendable] = [
            DispatchQueue.Attributes.concurrent,
            DispatchQueue.GlobalQueuePriority.background,
            DispatchQueue.AutoreleaseFrequency.inherit,
            DispatchWorkItemFlags.assignCurrentContext,
            DispatchIO.StreamType.random,
            DispatchIO.CloseFlags.stop,
            DispatchIO.IntervalFlags.strictInterval,
            DispatchData.empty,
            DispatchData.Deallocator.free,
            DispatchData.empty.makeIterator(), // DispatchDataIterator
        ]
    }
}

Expected behavior

The example program should compile without errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant