Skip to content

[6.0] Ensure that we do not turn rvalues into lvalues #73910

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

Conversation

DougGregor
Copy link
Member

@DougGregor DougGregor commented May 25, 2024

Explanation: The computation that determined whether an access to a let instance property within a constructor should be an initialization conflated the cases of "we don't have a base expression" and "the base expression is not something that could be self", and incorrectly identified rvalue bases as being "initializable". Make the interface properly separate out these cases, so we don't turn an lvalue into an rvalue access.
Original PR: #73909
Radar/issue: rdar://128661833
Risk: Low. Fixes a recent regression in the shape of the AST to make it more narrow.

The computation that determined whether an access to a `let` instance
property within a constructor should be an initialization conflated the
cases of "we don't have a base expression" and "the base expression is
not something that could be `self`", and incorrectly identified rvalue
bases as being "initializable". Make the interface properly separate
out these cases, so we don't turn an lvalue into an rvalue access.

Fixes rdar://128661833.
@DougGregor DougGregor requested a review from a team as a code owner May 25, 2024 01:26
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor DougGregor enabled auto-merge May 25, 2024 05:43
@DougGregor
Copy link
Member Author

@swift-ci please test macOS

@DougGregor DougGregor merged commit f73b5ed into swiftlang:release/6.0 May 25, 2024
5 checks passed
@DougGregor DougGregor deleted the let-instance-property-mutability-fix-6.0 branch May 26, 2024 21:10
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