Skip to content

Missing diagnostic when capturing self in deinit Task #72892

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

Closed
rnapier opened this issue Apr 6, 2024 · 0 comments
Closed

Missing diagnostic when capturing self in deinit Task #72892

rnapier opened this issue Apr 6, 2024 · 0 comments

Comments

@rnapier
Copy link

rnapier commented Apr 6, 2024

          Seems feasible. The overall trouble with static analysis is that it's semi-common (especially when using AppKit/UIKit) to pass `self` out to other methods in deinit that then do Mysterious Things to it, and you're essentially pinky promising that it doesn't _really_ escape. That means the compiler can't be too strict about it. But capturing `self` with a `Task` or async dispatch is pretty much guaranteed to be wrong, so a warning should be doable for those specific cases.

Originally posted by @mikeash in #62191 (comment)

@rnapier rnapier closed this as completed Apr 6, 2024
@rnapier rnapier closed this as not planned Won't fix, can't repro, duplicate, stale Apr 6, 2024
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

No branches or pull requests

1 participant