forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Parse/Sema][SR-1672] Improve diagnostics for trailing closures in st…
…mt-condition (swiftlang#3184) Fix-it suggests normal argument expression, instead of of enclosing whole expression with parens. * Moved diagnostic logic to Sema, because we have to add correct argument label for the closure. if arr.starts(with: IDs) { $0.id == $2 } { ... } ~~^ , isEquivalent: ) * We now accept trailing closures for each expressions and right before `where` clause, as well as closures right before the body. if let _ = maybeInt { 1 }, someOtherCondition { ... } ~^ ( ) for let x in arr.map { $0 * 4 } where x != 0 { ... } ~^ ( )
- Loading branch information
Showing
6 changed files
with
201 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters