Skip to content

Fix Fix-It locations for "unsafe" insertion #79265

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 3 commits into from
Feb 10, 2025

Conversation

DougGregor
Copy link
Member

The locations for inserting "unsafe" within Fix-Its were wrong in a few places. Fix them:

  • Look through auto closures, so we don't insert to the right-hand side of a && or ||
  • Don't stop at implicit declaration references

The implicit reference to the initializer was tripping up the logic
for finding the appropriate place to insert "unsafe", and it was ending
up in the middle of the expression.
… Fix-It

Otherwise, we'll end up inserting the "unsafe" on the right-hand side of an &&
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor DougGregor enabled auto-merge February 10, 2025 14:56
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor DougGregor merged commit bda17b0 into swiftlang:main Feb 10, 2025
3 checks passed
@DougGregor DougGregor deleted the unsafe-fixit-fixes branch February 10, 2025 21:15
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