Skip to content

[3.1] SILGen: Avoid useless bitcasts when IUO-to-Optional conversion happens. #6914

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
Jan 19, 2017

Conversation

jckarter
Copy link
Contributor

Explanation: In SIL, the distinction between IUO and Optional is now lowered away, so there's no reason to emit any SIL at all when an IUO is converted to Optional formally in the AST. (Eventually this distinction ought to go away at the type system level too…) Memory promotion didn't understand initializations through unchecked_*_casts and would incorrectly flag them as improper captures, causing rdar://problem/26899492.

Scope: Users attempting to access IUO properties from inside lldb would get bogus errors about improper variable capture.

Radar Issue: rdar://problem/26899492

Risk: Low

Testing: Swift CI

In SIL, the distinction between IUO and Optional is now lowered away, so there's no reason to emit any SIL at all when an IUO is converted to Optional formally in the AST. (Eventually this distinction ought to go away at the type system level too…) Memory promotion didn't understand initializations through unchecked_*_casts and would incorrectly flag them as improper captures, causing rdar://problem/26899492.
@jckarter
Copy link
Contributor Author

@swift-ci Please test

@ematejska ematejska merged commit bb4d406 into swiftlang:swift-3.1-branch Jan 19, 2017
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