Skip to content

[Parser] Allow closures with custom attributes and capture lists. #37987

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

Conversation

DougGregor
Copy link
Member

Explanation: Parse closures with both a custom attribute (e.g., @MainActor) and a capture list without complaining about Swift 1.0 beta 1 array type syntax.
Scope: Affects new code making use of concurrency.
Radar/SR Issue: rdar://77303587
Risk: Low.
Testing: PR testing and CI on main.
Original PR: #37986

The parsing of Swift 1.0 beta-1 array syntax (e.g., `Int [something]`)
was preventing closures with both a custom attribute (e.g.,
`@MainActor) and a capture list from parsing correctly. Don't parse
that syntax within custom attributes.

Fixes rdar://77303587.
@DougGregor DougGregor requested a review from a team as a code owner June 19, 2021 05:22
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor
Copy link
Member Author

@swift-ci please nominate

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - feb1787

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - feb1787

@DougGregor
Copy link
Member Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 959a41f

@DougGregor
Copy link
Member Author

@swift-ci please test macOS

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 959a41f

@DougGregor
Copy link
Member Author

@swift-ci please test macOS

1 similar comment
@DougGregor
Copy link
Member Author

@swift-ci please test macOS

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 959a41f

@DougGregor
Copy link
Member Author

@swift-ci please test macOS

@tkremenek tkremenek merged commit 4939e8f into swiftlang:release/5.5 Jun 24, 2021
@DougGregor DougGregor deleted the parse-closure-attributes-and-captures-5.5 branch June 24, 2021 05:19
@AnthonyLatsis AnthonyLatsis added 🍒 release cherry pick Flag: Release branch cherry picks swift 5.5 labels Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 5.5
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants