Skip to content

Correctly format unsafe when preceding a for loop pattern.#1189

Merged
allevato merged 2 commits into
swiftlang:mainfrom
allevato:unsafe-loop
Apr 13, 2026
Merged

Correctly format unsafe when preceding a for loop pattern.#1189
allevato merged 2 commits into
swiftlang:mainfrom
allevato:unsafe-loop

Conversation

@allevato
Copy link
Copy Markdown
Member

Fixes #1183.

Copy link
Copy Markdown
Contributor

@hamishknight hamishknight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Comment on lines +660 to +661
for i in 0..<(modifiers.count - 1) {
after(modifiers[i], tokens: .break)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for modifier in modifiers.dropLast()?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@allevato allevato merged commit e276f58 into swiftlang:main Apr 13, 2026
27 checks passed
@allevato allevato deleted the unsafe-loop branch April 13, 2026 15:54
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.

unsafe in for loop incorrectly drops trailing trivia

2 participants