Skip to content

[6.2][Diagnostics] Correctly diagnose situations when immutable value is passed to inout parameter #82114

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 10, 2025

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Jun 9, 2025

Cherry-pick of #82053


xedin added 2 commits June 9, 2025 09:39
…uting a callee

This element is used purely for diagnostic purposes and locator
should behavior as if it's completely transparent.

(cherry picked from commit 622475b)
…assed to `inout` parameter

Currently the note is going to point to the "callee" but that is
incorrect when the failure is related to an argument of a call.

Detect this situation in `RValueTreatedAsLValueFailure::diagnoseAsNote`
and produce a correct note.

Resolves: rdar://150689994
(cherry picked from commit 6bbc101)
@xedin xedin requested a review from a team as a code owner June 9, 2025 16:42
@xedin xedin added 🍒 release cherry pick Flag: Release branch cherry picks swift 6.2 labels Jun 9, 2025
@xedin
Copy link
Contributor Author

xedin commented Jun 9, 2025

@swift-ci please test

@xedin xedin merged commit 27cd5ee into swiftlang:release/6.2 Jun 10, 2025
5 checks passed
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