Skip to content

[5.9] Pick new diagnostic for unsafe 'begin' methods: suggest using for loop. #65659

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

Closed

Conversation

zoecarver
Copy link
Contributor

@zoecarver zoecarver commented May 4, 2023

Explanation: 'begin' is one of the most commonly used methods that returns an iterator. We should lead Swift users towards using the collection/sequence API interface, not the Swift iterator interface. This is a UX improvement that we want in 5.9.
Testing: Swift unit tests, manual testing.
Scope: Swift's and C++ interoperability, diagnostics
Risk: extra-low. This only changes the text of a diagnostic; this is a non-functional change.
Reviewers: @hyp @xedin

… for-loop instead.

Does not fix the fix-it. The current fix it will be left as a stop-gap solution and we can hopefully update this fix it in the near future to actually plop in a for loop (too much work for this PR though).
@zoecarver zoecarver requested a review from a team as a code owner May 4, 2023 17:32
@hyp
Copy link
Contributor

hyp commented May 4, 2023

Presumably you'll pick #65658 to 5.9 later as well right :)

@zoecarver
Copy link
Contributor Author

Presumably you'll pick #65658 to 5.9 later as well right :)

I was just going to let that land on main and be picked up whenever. I don't think it's a big deal, but I can incorporate it if you want.

@hyp
Copy link
Contributor

hyp commented May 4, 2023

I was just going to let that land on main and be picked up whenever. I don't think it's a big deal, but I can incorporate it if you want.

Sure, I don't have a strong opinion there.

@zoecarver
Copy link
Contributor Author

@swift-ci please test

@ravikandhadai
Copy link
Contributor

Closing this PR as this is not essential for 5.9.

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.

4 participants