Skip to content

Fix LifetimeDependenceScopeFixup: extend scopes enclosing coroutines #81207

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

Conversation

atrick
Copy link
Contributor

@atrick atrick commented Apr 30, 2025

This is a single-commit PR. Prior commits are from #81191, which is already on 6.2 but blocked by CI.

  • Fix LifetimeDependenceScopeFixup: extend scopes enclosing coroutines
    When a coroutine is extended because of a dependent lifetime, extend all scopes
    that enclose that coroutine even if the coroutine itself has no lifetime
    dependencies.

    Fixes rdar://150275147 (Invalid SIL after lifetime dependence fixup involving
    coroutines)

atrick added 7 commits April 30, 2025 09:13
When the type checker encounters incomplete type error, bail out early to avoid
an assertion.
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)
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.
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"
When a coroutine is extended because of a dependent lifetime, extend all scopes
that enclose that coroutine even if the coroutine itself has no lifetime
dependencies.

Fixes rdar://150275147 (Invalid SIL after lifetime dependence fixup involving
coroutines)
@atrick
Copy link
Contributor Author

atrick commented Apr 30, 2025

@swift-ci smoke test

@atrick atrick enabled auto-merge April 30, 2025 18:31
Copy link
Contributor

@meg-gupta meg-gupta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

outer scope extension - lgtm

@atrick atrick merged commit 6735659 into swiftlang:main Apr 30, 2025
3 checks passed
@atrick atrick deleted the extend-coroutine branch April 30, 2025 23:07
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