Skip to content

Commit f28284d

Browse files
committed
Better handle non-refutable patterns in async transform
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
1 parent 3440234 commit f28284d

File tree

2 files changed

+722
-50
lines changed

2 files changed

+722
-50
lines changed

0 commit comments

Comments
 (0)