Skip to content

[6.2] LifetimeDependenceDiagnostics: bug fixes and output clarity #81192

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 6 commits into from
Apr 30, 2025

Conversation

atrick
Copy link
Contributor

@atrick atrick commented Apr 30, 2025

  • LifetimeDependence type checking: avoid an assertion on error.
    When the type checker encounters incomplete type error, bail out early to avoid
    an assertion.

    (cherry picked from commit 36551e3)

  • LifetimeDependenceDiagnostics: avoid infinite recursion on error
    Fix a simple typo that results in infinite recursion on invalid code.

    Fixes rdar://147470493 ([nonescapable] LifetimeDependenceInsertion: infinite
    recursion in VariableUseDefWalker.walkup with immortal setter)

    (cherry picked from commit c891d8a)

  • Refactor debugVarDecl so arguments also support debug_value users.
    (cherry picked from commit 49755bd)

  • [NFC] SwiftCompilerSource: bridge Function.accessorKindName
    (cherry picked from commit 25e9cbf)

  • LifetimeDependence: clarify diagnostics for many unusual cases.
    Ensure that we always issue a diagnostic on error, but avoid emitting any notes that don't have source locations.

    With implicit accessors and thunks, report the correct line number and indicate which accessor generates the error.

    Always check for debug_value users.

    Consistently handle access scopes across diagnostic analysis and diagnostic messages.

    (cherry picked from commit ec51286)

  • LifetimeDependenceDiagnostics: note for unsupported closure capture
    Add a note explaining that dependence on closure captures is not
    supported. Otherwise, the diagnostics are very confusing:
    "it depends on a closure capture; this is not yet supported"

    (cherry picked from commit 83b0ce1)

atrick added 6 commits April 30, 2025 00:09
When the type checker encounters incomplete type error, bail out early to avoid
an assertion.

(cherry picked from commit 36551e3)
Fix a simple typo that results in infinite recursion on invalid code.

Fixes rdar://147470493 ([nonescapable] LifetimeDependenceInsertion: infinite
recursion in VariableUseDefWalker.walkup with immortal setter)

(cherry picked from commit c891d8a)
Ensure that we always issue a diagnostic on error, but avoid emitting any notes that don't have source locations.

With implicit accessors and thunks, report the correct line number and indicate which accessor generates the error.

Always check for debug_value users.

Consistently handle access scopes across diagnostic analysis and diagnostic messages.

(cherry picked from commit ec51286)
Add a note explaining that dependence on closure captures is not
supported. Otherwise, the diagnostics are very confusing:
"it depends on a closure capture; this is not yet supported"

(cherry picked from commit 83b0ce1)
@atrick atrick requested a review from a team as a code owner April 30, 2025 07:12
@atrick atrick added 🍒 release cherry pick Flag: Release branch cherry picks swift 6.2 labels Apr 30, 2025
@atrick atrick requested a review from tbkka April 30, 2025 07:12
@atrick
Copy link
Contributor Author

atrick commented Apr 30, 2025

@swift-ci test

@atrick atrick enabled auto-merge April 30, 2025 07:13
@atrick atrick merged commit 3efcc14 into swiftlang:release/6.2 Apr 30, 2025
5 checks passed
@atrick atrick deleted the 62-var-walker-recursion branch April 30, 2025 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 6.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants