Files
swift-mirror/test/refactoring/TrailingClosure/Outputs/basic/L9.swift.expected
Rintaro Ishizaki 1ca88478a8 [Refactoring] Handle TupleShuffleExpr in "convert to trailing closure"
Fixes crash in "Convert To Trailing Closure" action if call has
defaulted parameters. Handle `TupleShuffleExpr` properly.

rdar://problem/41093898
2018-06-18 16:18:58 +09:00

26 lines
442 B
Plaintext

struct Foo {
static func foo(a: () -> Int) {}
func qux(x: Int, y: () -> Int ) {}
}
func testTrailingClosure() -> String {
Foo.foo(a: { 1 })
Foo.bar(a: { print(3); return 1 })
Foo().qux(x: 1) { 1 }
let _ = Foo().quux(x: 1, y: { 1 })
[1,2,3]
.filter({ $0 % 2 == 0 })
.map({ $0 + 1 })
}
func foobar(first: String? = nil, closure: () -> Void) { fatalError() }
func blah() {
_ = foobar(closure: { print("foo") })
}