Skip to content

Revert "Use numericCast() to get the correct type when creating a dis… #446

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
Feb 13, 2019

Conversation

compnerd
Copy link
Member

…patch_block_flags_t."

This reverts commit b048490.

Unfortunately, the numeric cast'ed value cannot be used to construct the
dispatch_flags_t type. Trying to change to an explicit construction
also fails. This repairs the Windows build for the time being.

@compnerd
Copy link
Member Author

@swift-ci please test

@compnerd
Copy link
Member Author

CC: @ktopley-apple

Copy link
Contributor

@ktopley-apple ktopley-apple left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't correct. The last change I made is needed for the non-Windows case:

#if os(Windows) && arch(x86_64)
		let flags = dispatch_block_flags_t(UInt32(flags.rawValue))
#else
                    let flags: dispatch_block_flags_t = numericCast(flags.rawValue)
#endif

@compnerd compnerd force-pushed the sometimes-code-is-ugly branch from 1de7509 to 102c1c7 Compare February 13, 2019 16:37
@compnerd
Copy link
Member Author

Oh, I see; okay, changed to a partial revert. Thanks!

@compnerd
Copy link
Member Author

@swift-ci please test

…patch_block_flags_t."

This (partially) reverts commit b048490.

Unfortunately, the numeric cast'ed value cannot be used to construct the
dispatch_flags_t type.  Trying to change to an explicit construction
also fails.  This repairs the Windows build for the time being.  Use the
`numericCast` for other targets.
@compnerd compnerd force-pushed the sometimes-code-is-ugly branch from 102c1c7 to a9e4d44 Compare February 13, 2019 17:39
@compnerd
Copy link
Member Author

@swift-ci please test

Copy link
Contributor

@ktopley-apple ktopley-apple left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now and it should build.

@compnerd
Copy link
Member Author

@ktopley-apple - okay to merge?

@ktopley-apple ktopley-apple merged commit bc00e13 into swiftlang:master Feb 13, 2019
@ktopley-apple
Copy link
Contributor

Yes, done. Thanks for fixing this up 👍

@compnerd compnerd deleted the sometimes-code-is-ugly branch February 13, 2019 19:16
@compnerd
Copy link
Member Author

My pleasure!

rokhinip pushed a commit that referenced this pull request Nov 5, 2021
Revert "Use numericCast() to get the correct type when creating a dis…

Signed-off-by: Kim Topley <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants