-
Notifications
You must be signed in to change notification settings - Fork 247
UseShorthandTypeNames incorrect with Sendable functions #657
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
Comments
The fix in #589 only covered |
allevato
added a commit
to allevato/swift-format
that referenced
this issue
Nov 20, 2023
Like with `some/any` type sugar, when we simplify an `Optional` whose type parameter is an attributed type, we need to wrap it in parentheses so that the `?` doesn't bind with the contained type. Fixes swiftlang#657.
ahoppen
pushed a commit
to ahoppen/swift-format
that referenced
this issue
Mar 16, 2024
Like with `some/any` type sugar, when we simplify an `Optional` whose type parameter is an attributed type, we need to wrap it in parentheses so that the `?` doesn't bind with the contained type. Fixes swiftlang#657.
ahoppen
pushed a commit
to ahoppen/swift-format
that referenced
this issue
Mar 16, 2024
Like with `some/any` type sugar, when we simplify an `Optional` whose type parameter is an attributed type, we need to wrap it in parentheses so that the `?` doesn't bind with the contained type. Fixes swiftlang#657.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If I start with the code
var a: Optional< @Sendable (Int) -> (Float)> = nil
and apply
swift-format format --parallel --recursive --in-place Sources
version 509.0.0 the code becomesvar a: @Sendable (Int) -> (Float)? = nil
The optionalness has moved from the whole phrase to just the return type. This has a different meaning. The new code doesn't compile because of this.
The text was updated successfully, but these errors were encountered: