[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:
Xi Ge
2016-07-02 08:11:58 -07:00
committed by GitHub
parent 2c534769c3
commit 1886b4ab56
15 changed files with 235 additions and 39 deletions

View File

@@ -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
})
}