Skip to content

Commit 90835fb

Browse files
3405691582compnerd
authored andcommitted
Fix initializing of dispatch_block_flags_t.
Without this change, `Block.swift` fails to compile complaining that "'numericCast' requires that 'dispatch_block_flags_t' conform to 'BinaryInteger'". A number of changes may have tickled this, possibly: improved recent type handling in the Swift compiler, more stringent handling of C enum types, or changes to the `DISPATCH_OPTIONS` macro. Regardless, this change solves the problem.
1 parent c4b6d25 commit 90835fb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/swift/Block.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class DispatchWorkItem {
4343
#if os(Windows) && (arch(arm64) || arch(x86_64))
4444
let flags = dispatch_block_flags_t(rawValue: UInt32(flags.rawValue))
4545
#else
46-
let flags: dispatch_block_flags_t = numericCast(flags.rawValue)
46+
let flags = dispatch_block_flags_t(rawValue: flags.rawValue)
4747
#endif
4848
_block = dispatch_block_create_with_qos_class(flags,
4949
qos.qosClass.rawValue.rawValue, Int32(qos.relativePriority), block)
@@ -55,7 +55,7 @@ public class DispatchWorkItem {
5555
#if os(Windows) && (arch(arm64) || arch(x86_64))
5656
let flags = dispatch_block_flags_t(rawValue: UInt32(flags.rawValue))
5757
#else
58-
let flags: dispatch_block_flags_t = numericCast(flags.rawValue)
58+
let flags = dispatch_block_flags_t(rawValue: flags.rawValue)
5959
#endif
6060
_block = _swift_dispatch_block_create_noescape(flags, noescapeBlock)
6161
}

0 commit comments

Comments
 (0)