Skip to content

LifetimeDependenceScopeFixup: handle yielded value copies. #82049

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 2 commits into from
Jun 6, 2025

Conversation

atrick
Copy link
Contributor

@atrick atrick commented Jun 6, 2025

  • [NFC] LifetimeDependence: fix internal debug output

  • LifetimeDependenceScopeFixup: handle yielded value copies.
    When extending an access scope over a coroutines, instead of simply
    considering the lifetime of the coroutine scope, recurse through all
    uses of yielded values. They may be copyable, non-Escapable values
    that depend on the coroutine operand.

    Fixes rdar://152693622 (Extend coroutines over copied yields)

@atrick atrick requested a review from eeckstein as a code owner June 6, 2025 03:17
When extending an access scope over a coroutines, instead of simply
considering the lifetime of the coroutine scope, recurse through all
uses of yielded values. They may be copyable, non-Escapable values
that depend on the coroutine operand.

Fixes rdar://152693622 (Extend coroutines over copied yields)
@atrick atrick force-pushed the lifedep-fix-yield branch from 82a1360 to 227f802 Compare June 6, 2025 03:21
@atrick atrick requested a review from meg-gupta June 6, 2025 03:26
@atrick
Copy link
Contributor Author

atrick commented Jun 6, 2025

@swift-ci test

@atrick atrick enabled auto-merge June 6, 2025 03:27
@atrick atrick merged commit eab76a4 into swiftlang:main Jun 6, 2025
5 checks passed
@atrick atrick deleted the lifedep-fix-yield branch June 6, 2025 16:35
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.

LGTM. Would be helpful to add swift source code in comments or a separate test.

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