qos_class_t not convertible to Int for use with dispatch_get_global_queue

Originator:brandon
Number:rdar://17758225 Date Originated:July 21, 2014
Status:Duplicate Resolved:
Product:OS X SDK Product Version:10.10
Classification:Serious Bug Reproducible:Always
 
Marked as duplicate of 18272350

Summary:
Attempting to use a QOS class as an argument to the GCD function `dispatch_get_global_queue` in the Swift language fails with the reason "error: 'qos_class_t' is not convertible to 'Int'". It appears that unlike `dispatch_queue_attr_make_with_qos_class` which explicitly requires a dispatch_qos_class_t (a typealiased qos_class_t) argument, `dispatch_get_global_queue`'s signature accepts an Int so that it's compatible with the older dispatch_queue_priority_t values. In this case it means that it's not possible to use quality of service values as is recommended[1] by the documentation.

[1]: "It is recommended to use quality of service class values to identify the well-known global concurrent queues."

Steps to Reproduce:
1. Install Xcode 6 Beta 4
2. Create a new OS X playground (note that this issue occurs on both platforms, but for the sake of example...)
3. Enter the code `let queue = dispatch_get_global_queue(QOS_CLASS_BACKGROUND, 0)`
4. Observe warning

Expected Results:
I would expect `dispatch_get_global_queue` to accept both the older dispatch queue priorities and newer QOS classes.

Actual Results:
An error occurs

Version:
Version 6.0 (6A267n)
Version 10.10 (14A298i)

Notes:


Configuration:
Always occurs running Xcode 6 Beta 4 in Yosemite 10.10 Beta 4

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!