Skip to content

Use the existing '.rawValue' fix-it to handle unwrapping objects too. #4910

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

Conversation

jrose-apple
Copy link
Contributor

We could probably make this even more general, but this specifically avoids trying to insert an "as AnyObject" fix-it, which will now work but probably produce an incorrect result. This comes up when working with swift_newtype wrappers of CF types being passed to CFTypeRef parameters.

While here, also fix a copy/paste issue with the existing logic.

rdar://problem/26678862

We could probably make this even more general, but this specifically
avoids trying to insert an "as AnyObject" fix-it, which will now work
but probably produce an incorrect result. This comes up when working
with swift_newtype wrappers of CF types being passed to CFTypeRef
parameters.

rdar://problem/26678862
@jrose-apple
Copy link
Contributor Author

@akyrtzi, can you review this? Are you okay with me hijacking your and @slavapestov's logic for this?

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - 693fd9d
Test requested by - @jrose-apple

@akyrtzi
Copy link
Contributor

akyrtzi commented Sep 22, 2016

LGTM!

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - 693fd9d
Test requested by - @jrose-apple

@jrose-apple jrose-apple merged commit 821cdf3 into swiftlang:master Sep 22, 2016
@jrose-apple jrose-apple deleted the fix-it-swift_newtype-rawValue branch September 22, 2016 01:28
jrose-apple added a commit to jrose-apple/swift that referenced this pull request Sep 22, 2016
…pe-rawValue

Use the existing '.rawValue' fix-it to handle unwrapping objects too.

rdar://problem/26678862
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.

3 participants