Skip to content

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

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

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Jun 6, 2025

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

…uting a callee

This element is used purely for diagnostic purposes and locator
should behavior as if it's completely transparent.
@xedin xedin requested review from hborla and slavapestov as code owners June 6, 2025 05:31
@xedin
Copy link
Contributor Author

xedin commented Jun 6, 2025

@swift-ci please test

…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
@xedin xedin force-pushed the rdar-150689994 branch from 19f761b to 6bbc101 Compare June 6, 2025 21:36
@xedin
Copy link
Contributor Author

xedin commented Jun 6, 2025

@swift-ci please smoke test

@xedin
Copy link
Contributor Author

xedin commented Jun 6, 2025

@swift-ci please smoke test Linux platform

2 similar comments
@xedin
Copy link
Contributor Author

xedin commented Jun 7, 2025

@swift-ci please smoke test Linux platform

@xedin
Copy link
Contributor Author

xedin commented Jun 8, 2025

@swift-ci please smoke test Linux platform

@xedin xedin merged commit a5d92bc into swiftlang:main Jun 9, 2025
3 checks passed
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