DISPATCH_ENUM will use a typed enum which creates a typedef to an
elaborated type. This fails to be imported into Swift as a numeric
type. Explicitly convert the numericCast'ed value from the Swift
OptionSet to the dispatch_block_flags_t as a portable alternate
spelling. This allows us to continue to import the enum as a typed
value.
Thanks to @beccadax for the pointer that this pattern may not work on
Darwin (which it does not!) and the suggestion for the explicit type
conversion!
DISPATCH_ENUM
will use a typed enum which creates a typedef to an elaborated type. This fails to be imported into Swift as a numeric type. Explicitly convert thenumericCast
'ed value from the SwiftOptionSet
to thedispatch_block_flags_t
as a portable alternate spelling. This allows us to continue to import the enum as a typed value.Thanks to @beccadax for the pointer that this pattern may not work on Darwin (which it does not!) and the suggestion for the explicit type conversion!