Skip to content
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

[SR-7015] Fix CoreFoundation conditional downcast diagnostic #16441

Closed

Conversation

naru-jpn
Copy link
Contributor

@naru-jpn naru-jpn commented May 8, 2018

Fix CoreFoundation conditional downcast diagnostic.


Fix message and add fix-it to fix error.
For example, this fix-it replace

_ = 10 as? CFString

with

_ = (CFGetTypeID(10 as AnyObject) == CFStringGetTypeID()) ? (10 as! CFString) : nil

This replacement also works well in case of if let _ = 10 as? CFString { ... }.


Resolves SR-7015.

@naru-jpn
Copy link
Contributor Author

naru-jpn commented May 8, 2018

I missed PR for same problem.

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.

None yet

1 participant