-
Notifications
You must be signed in to change notification settings - Fork 452
Fix support for trailing commas in tuples within generic arguments #3153
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
Fix support for trailing commas in tuples within generic arguments #3153
Conversation
baaz: String, | ||
)>() | ||
""", | ||
substructure: FunctionCallExprSyntax( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to include the substructure:
because this test case succeeded as-is without the fix, even though the parsed output was incorrect:
assertParse(
"""
let _ = Array<(
bar: String,
baaz: String,
)>()
"""
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thank you!
swiftlang/swift#84421 |
Regarding the "Format check" failure, please run |
af713f4
to
d27e1e3
Compare
done, thanks! |
swiftlang/swift#84421 |
swiftlang/swift#84421 |
swiftlang/swift#84421 |
swiftlang/swift#84421 |
Thanks @rintaro! |
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.Corresponding compiler PR: swiftlang/swift#84421