Skip to content

[move-only-object] Teach move only object verifier how to emit proper errors for closure/defer uses #62567

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

gottesmm
Copy link
Contributor

Specifically, we error if one consumes a value at all in side a closure/defer and do not make a distinction in between no escape, defer, and escaping closures. This is just to make a sane base model that we can then build on top of.

rdar://103313305

…ic to improve QoI.

Specifically, I want to add a special diagnostic for closure captures. By doing
this as a separate commit it is easier to review/etc.
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

…opy.

The current diagnostic that we are emitting is not perfect, but at least this
prevents us from saying that an error is not occuring here. I am going to file a
bug to track the QoI work of improving the diagnostic.

rdar://103313305
@gottesmm gottesmm requested a review from kavon December 14, 2022 18:58
@gottesmm gottesmm force-pushed the pr-aff949c3a3e3aaf7839d4462bd96b8eb60c06f97 branch from 5db3bd5 to 0735f9f Compare December 14, 2022 18:58
@gottesmm
Copy link
Contributor Author

Found a small bug where I forgot that createStore with a managed value clones the cleanup of the passed in value. A bit of a footgun when using initializations. I added a test to make sure that we catch it in the test suite and not just when compiling code.

@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

@gottesmm
Copy link
Contributor Author

Windows failed in LLVM

@gottesmm gottesmm merged commit f735eda into swiftlang:main Dec 14, 2022
@gottesmm gottesmm deleted the pr-aff949c3a3e3aaf7839d4462bd96b8eb60c06f97 branch December 14, 2022 21:51
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.

1 participant