Skip to content

[CSDiagnostics] Diagnose invalid optional unwrap via fixes #21043

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
Dec 6, 2018

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Dec 5, 2018

Detect and fix situations when (force) unwrap is used on
a non-optional type, this helps to diagnose invalid unwraps
precisely and provide fix-its.

Resolves: SR-8977
Resolves: rdar://problem/45218255

xedin added 2 commits December 4, 2018 18:40
If the base type is not optional, trying to unwrap it is
incorrect. Introduce a fix to make it look like base was
an optional type which leads solver to move forward
towards possible solution.
Detect and fix situations when (force) unwrap is used on
a non-optional type, this helps to diagnose invalid unwraps
precisely and provide fix-its.

Resolves: [SR-8977](https://bugs.swift.org/browse/SR-8977)
Resolves: rdar://problem/45218255
@xedin xedin requested a review from rudkx December 5, 2018 16:34
@xedin
Copy link
Contributor Author

xedin commented Dec 5, 2018

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Dec 5, 2018

Build failed
Swift Test OS X Platform
Git Sha - 202234f

@xedin
Copy link
Contributor Author

xedin commented Dec 5, 2018

Test failure is unrelated to diagnostics but let's re-try, maybe the fix already went in...

@xedin
Copy link
Contributor Author

xedin commented Dec 5, 2018

@swift-ci please test macOS platform

@xedin
Copy link
Contributor Author

xedin commented Dec 5, 2018

Addressed by #21047

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.

4 participants