Skip to content

[Clang importer] swift_newtype with bridged computed rawValue #2319

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 2 commits into from
Apr 27, 2016

Conversation

milseman
Copy link
Member

What's in this pull request?

Resolved bug number: (SR-)


Before merging this pull request to apple/swift repository:

  • Test pull request on Swift continuous integration.

Triggering Swift CI

The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:

Smoke Testing

Platform Comment
All supported platforms @swift-ci Please smoke test
OS X platform @swift-ci Please smoke test OS X platform
Linux platform @swift-ci Please smoke test Linux platform

Validation Testing

Platform Comment
All supported platforms @swift-ci Please test
OS X platform @swift-ci Please test OS X platform
Linux platform @swift-ci Please test Linux platform

Note: Only members of the Apple organization can trigger swift-ci.

For swift_newtype structs that we create, we sometimes need to provide
a bridged type interface. In these cases, we use the original
non-bridged type as an underlying stored value, and create a computed
rawValue of bridged type. We similarly create an init() taking the
bridged type, and cast it appropriately to/from storage.

Tests updated.

For swift_newtype structs that we create, we sometimes need to provide
a bridged type interface. In these cases, we use the original
non-bridged type as an underlying stored value, and create a computed
rawValue of bridged type. We similarly create an init() taking the
bridged type, and cast it appropriately to/from storage.

Tests updated.
@milseman
Copy link
Member Author

@swift-ci please test
@DougGregor please review

@DougGregor
Copy link
Member

We couldn't parameterized makeStructRawValued further? There is a ton of duplicated code here...

Incorporates review feedback to re-use code more. Improves
swift_newtype testing by also testing non-bridging path.
@milseman
Copy link
Member Author

@swift-ci please test

@milseman milseman merged commit aa1a685 into swiftlang:master Apr 27, 2016
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