Skip to content

Missing diagnostic when capturing self in deinit Task #72892

@rnapier

Description

@rnapier
          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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions