Skip to content

[SwiftSyntax] Test adjustments because no space is inserted between #available and ( by SwiftSyntax anymore #72960

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

Merged

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Apr 10, 2024

  • Explanation: There are only a few cases where ( should be preceded by a space: closure parameters, function types and tuples. Instead of defaulting to add whitespace before (, check for those cases and if we are not in one of them, don’t require whitespace. This has become important since we diagnose a space between an attribute name an it’s opening ( as a warning in Swift 5 and as an error in Swift 6 mode.
  • Scope: Running BasicFormat on source code that contains a non-keyword token followed by (.
  • Risk: I don’t see any case where not emitting a space in front of ( could break something apart from the cases that we have covered. And without this fix, a lot of code generated by macros does not compile in Swift 6 mode.
  • Testing: Added tests
  • Issue: rdar://124569733
  • Reviewer: @bnbarham on Default to not requiring whitespace before ( swift-syntax#2592

@ahoppen ahoppen requested a review from a team as a code owner April 10, 2024 20:14
@ahoppen ahoppen changed the title [SwiftSyntax] Test adjustments because no space is inserted between `… [SwiftSyntax] Test adjustments because no space is inserted between #available and ( by SwiftSyntax anymore Apr 10, 2024
@ahoppen
Copy link
Member Author

ahoppen commented Apr 10, 2024

swiftlang/swift-syntax#2595

@swift-ci Please test

@ahoppen ahoppen force-pushed the 6.0/no-space-before-open-paren branch from f23fd06 to f81e89b Compare April 11, 2024 01:30
@ahoppen
Copy link
Member Author

ahoppen commented Apr 11, 2024

swiftlang/swift-syntax#2595

@swift-ci Please test

@ahoppen ahoppen merged commit 61b78fc into swiftlang:release/6.0 Apr 11, 2024
@ahoppen ahoppen deleted the 6.0/no-space-before-open-paren branch April 11, 2024 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants