Skip to content

Conversation

@atrick
Copy link
Contributor

@atrick atrick commented May 3, 2025

A setter on a non-Escapable type may have a dependency on both it's incoming
'self' and 'newValue'. If the 'newValue' dependency does not match the getter's
dependency, then lifetime diagnostics will not accept the generated '_modify'
accessor:

error: lifetime-dependent value returned by generated accessor '_modify'

To fix this, make sure that we don't (conservatively) infer a borrow
dependency on 'newValue'.

Fixes rdar://150444400

A setter on a non-Escapable type may have a dependency on both it's incoming
'self' and 'newValue'. If the 'newValue' dependency does not match the getter's
dependency, then lifetime diagnostics will not accept the generated '_modify'
accessor:

error: lifetime-dependent value returned by generated accessor '_modify'

To fix this, make sure that we don't (conservatively) infer a borrow
dependency on 'newValue'.

Fixes rdar://150444400
@atrick
Copy link
Contributor Author

atrick commented May 3, 2025

@swift-ci test

@atrick atrick enabled auto-merge May 3, 2025 07:17
@atrick atrick merged commit d033eec into swiftlang:main May 3, 2025
4 of 5 checks passed
@atrick atrick deleted the rdar150403948-lifedep-walker-recurse branch May 4, 2025 00:19
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.

1 participant