Skip to content

swift: repair the Windows x86 build #598

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 22, 2022
Merged

Conversation

compnerd
Copy link
Member

For some reason numericCast does not permit casting the flags value:

S:\SourceCache\swift-corelibs-libdispatch\src\swift\Block.swift:46:39: error: global function 'numericCast' requires that 'dispatch_block_flags_t' conform to 'BinaryInteger'
                                                                                   let flags: dispatch_block_flags_t = numericCast(flags.rawValue)
                                                                                             ^
Swift.numericCast:1:24: note: where 'U' = 'dispatch_block_flags_t'
@inlinable public func numericCast<T, U>(_ x: T) -> U where T : BinaryInteger, U : BinaryInteger
                       ^
S:\SourceCache\swift-corelibs-libdispatch\src\swift\Block.swift:46:39: note: did you mean to use '.rawValue'?
                           let flags: dispatch_block_flags_t = numericCast(flags.rawValue)
                                                               ^
                                                                           .rawValue

For some reason `numericCast` does not permit casting the flags value:

~~~
S:\SourceCache\swift-corelibs-libdispatch\src\swift\Block.swift:46:39: error: global function 'numericCast' requires that 'dispatch_block_flags_t' conform to 'BinaryInteger'
                                                                                   let flags: dispatch_block_flags_t = numericCast(flags.rawValue)
                                                                                             ^
Swift.numericCast:1:24: note: where 'U' = 'dispatch_block_flags_t'
@inlinable public func numericCast<T, U>(_ x: T) -> U where T : BinaryInteger, U : BinaryInteger
                       ^
S:\SourceCache\swift-corelibs-libdispatch\src\swift\Block.swift:46:39: note: did you mean to use '.rawValue'?
                           let flags: dispatch_block_flags_t = numericCast(flags.rawValue)
                                                               ^
                                                                           .rawValue
~~~
@compnerd
Copy link
Member Author

CC: @rokhinip
This is a workaround for Windows ... I suspect that this has to do with the DISPATCH_ENUM macro definition. This enables the build, a subsequent fix for the enum import in the compiler is likely warranted.

@compnerd
Copy link
Member Author

@swift-ci please test

@compnerd compnerd merged commit 12a60ac into swiftlang:main Mar 22, 2022
@compnerd compnerd deleted the windows-x86 branch March 22, 2022 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant