Skip to content

[5.9] DefiniteInitialization: Error when noncopyable types are conditionally initialized. #66770

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

Conversation

jckarter
Copy link
Contributor

Issue: rdar://109695770
• Explanation: Introduces an error when noncopyable values are initialized in some code paths but not others. We handle this for copyable types by introducing dynamic flags to track when the value is initialized in order to know when to destroy it. However, borrow checking relies on static analysis and is incompatible in its current form with this dynamic checking, so we will disallow it for now.
• Scope of Issue: Disables unsupported code patterns.
• Origination: New feature work.
• Risk: low -- introduces a diagnostic for the new noncopyable types feature disallowing unsupported code.
• Reviewed By: @xedin and @gottesmm
• Automated Testing: Swift CI
• Dependencies: None
• Builder Impact: Not applicable
• Directions for QE: None

…y initialized.

This leads to unhandled complications in the move-only checker that were causing miscompiles.
We can disallow this for now. rdar://109695770
@jckarter jckarter requested a review from a team as a code owner June 20, 2023 17:18
@jckarter
Copy link
Contributor Author

@swift-ci Please test

@jckarter jckarter merged commit e80162f into swiftlang:release/5.9 Jun 21, 2023
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