duemunk / Async

Syntactic sugar in Swift for asynchronous dispatches in Grand Central Dispatch
MIT License
4.59k stars 316 forks source link

Fixed Xcode 10.2 warnings #136

Closed RomanPodymov closed 5 years ago

RomanPodymov commented 5 years ago

Hello. In this pull request I added @unknown default: to the implementation of DispatchQoS.QoSClass.description. It works fine with all supported Swift version in Xcode 10.2 (see this link for more details about @unknown). I added QoSClassDescription to unify the string constants using in DispatchQoS.QoSClass.description and qos_class_t.description. I also removed get in some computed properties.

duemunk commented 5 years ago

Thanks for creating this!

I see no reason to unify with a mirror enum for DispatchQoS.QoSClass. Could you remove that and just keep the @unkown default?

RomanPodymov commented 5 years ago

Hello @duemunk Currently AsyncSwift.swift is full of duplicate strings. I tried to solve this problem with an enum with associated values. DispatchQoS.QoSClass and qos_class_t are related to each other and QoSClassDescription demonstrates it. And when a new case will be added to DispatchQoS.QoSClass you won't add a new description twice. Please rename QoSClassDescription and propose a better description for it if you want.

RomanPodymov commented 5 years ago

Hello @duemunk I reverted my changes to f6be54a where I fixed Xcode 10.2 warnings. I put QoSClassDescription to another branch, so we can discuss this feature later.

duemunk commented 5 years ago

Perfekt @RomanPodymov!