Adding tuple destructuring

Consider code such as the following:

swift func foo(_: ((Int, Int) -> ()) {} foo { (x, y) in print(x + y) }

The migrator must add explicit tuple destructuring to continue building in Swift 4, such as shown here:

swift func foo(_: ((Int, Int) -> ()) {} foo { let (x, y) = $0; print(x + y) }

Get Reactive Programming with Swift 4 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.