Skip to content

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Sep 5, 2025

In Swift 6 and later, whitespace is no longer permitted between an attribute name and the opening parenthesis. Update the parser so that in Swift 6+, a '(' without preceding whitespace is always treated as the start of the argument list, while a '(' with preceding whitespace is considered the start of the argument list only when it is unambiguous.

This change makes the following closure be parsed correctly:

{ @MainActor (arg: Int) in ... }

rdar://147785544

@rintaro rintaro force-pushed the parse-attr-lparen-space-rdar147785544 branch from 0ab9384 to 08704ad Compare September 9, 2025 23:41
@rintaro
Copy link
Member Author

rintaro commented Sep 10, 2025

swiftlang/swift#84128
@swift-ci Please test

In Swift 6 and later, whitespace is no longer permitted between an
attribute name and the opening parenthesis. Update the parser so that in
Swift 6+, a '(' without preceding whitespace is always treated as the
start of the argument list, while a '(' with preceding whitespace is
considered the start of the argument list only when it is unambiguous.

This change makes the following closure be parsed correctly:

  ```swift
  { @mainactor (arg: Int) in ... }
  ```

rdar://147785544
@rintaro rintaro force-pushed the parse-attr-lparen-space-rdar147785544 branch from 08704ad to 16c4014 Compare September 11, 2025 18:39
@rintaro
Copy link
Member Author

rintaro commented Sep 11, 2025

swiftlang/swift#84128
@swift-ci Please test

@rintaro
Copy link
Member Author

rintaro commented Sep 12, 2025

swiftlang/swift#84128
@swift-ci Please test Windows

1 similar comment
@rintaro
Copy link
Member Author

rintaro commented Sep 12, 2025

swiftlang/swift#84128
@swift-ci Please test Windows

@rintaro rintaro merged commit 6673b05 into swiftlang:main Sep 13, 2025
29 of 31 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