mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Keep track of patterns that bind multiple vars and print them out when converting an async call. If the parameter being bound isn't referenced elsewhere, we'll print the pattern inline as e.g: ``` let ((x, y), z) = await foo() ``` Otherwise, if the parameter is referenced elsewhere in the block we'll print the pattern out of line, such as: ``` let (res, z) = await foo() let (x, y) = res ``` In addition, make sure to print var bindings out of line if there's also a let binding, e.g: ``` let x = await foo() var y = x ``` This ensures any mutations to y doesn't affect x. If there's only a single var binding, we'll print it inline. rdar://77802560
265 KiB
265 KiB