Skip to content

Add trailing comma support in cases missing from Swift 6.1 #3080

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

calda
Copy link

@calda calda commented May 19, 2025

Corresponding compiler PR: swiftlang/swift#81612


In Swift 6.1, there are many cases where trailing commas should be supported but currently are not:

This includes cases like:

let foo: (
  bar: String,
  quux: String, // unexpectedly not supported in Swift 6.1
)

let closure: (
  String,
  String, // unexpectedly not supported in Swift 6.1
) -> (
  bar: String,
  quux: String, // unexpectedly not supported in Swift 6.1
)

let foo: Foo<
  String,
  Int,
  Boo, // unexpectedly not supported in Swift 6.1
>

typealias Bar<
  T1,
  T2
> = Foo<
  T1,
  T2,
  Bool, // unexpectedly not supported in Swift 6.1
>

protocol Baaz<
  T1,
  T2, // unexpectedly not supported in Swift 6.1
> {
  associatedtype T1
  associatedtype T2
}

@rintaro
Copy link
Member

rintaro commented May 20, 2025

@swift-ci Please test

@calda
Copy link
Author

calda commented May 20, 2025

Failure in the Swift Test macOS Platform job looks unrelated to me -- the Linux test passed 👍🏻

@rintaro
Copy link
Member

rintaro commented May 20, 2025

swiftlang/swift#81612
@swift-ci Please test

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