Skip to content

Conversation

calda
Copy link
Contributor

@calda calda commented Sep 20, 2025

This PR fixes support for trailing commas in tuples within generic arguments.

This currently fails to compile in Swift 6.2 due to being parsed incorrectly. The type lookahead returns false so it confuses the < for a less-than operator.

// error: binary operator '<' cannot be applied to operands of type 'Array<_>.Type' and '(bar: String, baaz: String).Type'
let _ = Array<(
  bar: String,
  baaz: String,
)>()

Corresponding Swift Syntax PR: swiftlang/swift-syntax#3153

@rintaro
Copy link
Member

rintaro commented Sep 22, 2025

nicklockwood/SwiftFormat#2213
@swift-ci Please smoke test

@rintaro
Copy link
Member

rintaro commented Sep 22, 2025

swiftlang/swift-syntax#3153
@swift-ci Please smoke test

Copy link
Member

@rintaro rintaro 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 Cal!

@rintaro rintaro merged commit 3a02b20 into swiftlang:main Sep 23, 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