mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Fixit] Add a fixit for converting non-trailing closures to trailing closures (#3317)
* [Fixit] Add a fixit for converting non-trailing closures to trailing closures. * [test] Update test to reflect the added note about converting to trailing closures.
This commit is contained in:
@@ -5,10 +5,10 @@ func takeIntIntToInt(_ f: (Int, Int) -> Int) { }
|
||||
|
||||
// Simple closures
|
||||
func simple() {
|
||||
takeIntToInt({(x: Int) -> Int in
|
||||
takeIntToInt({(x: Int) -> Int in // expected-note {{use trailing closure to simplify arguments}}
|
||||
return x + 1
|
||||
})
|
||||
takeIntIntToInt({(x: Int, y: Int) -> Int in
|
||||
takeIntIntToInt({(x: Int, y: Int) -> Int in // expected-note {{use trailing closure to simplify arguments}}
|
||||
return x + y
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user