Observed Behavior: When a function parameter is a tuple containing one or more closure signatures, pressing Return while its placeholder is highlighted in Xcode's source editor produces incorrect code template expansion. All other parameters in the tuple are ignored. If the closure signatures have an empty (()) input pattern, then only the first closure found is expanded. If the the closures expect an input value, then those input values are erroneously aggregated and applied to a single expanded closure.
Expected behavior: The expansion should expand the tuple's signature completely, and for any closures it encounters it should produce fully labelled and parameterized closure structures.
Attachment: Download
Environment
Xcode 12.5 beta (12E5220o), Swift 5.3/5.4Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | CodeCompletion, SourceKit-LSP | |Labels | Bug, Parser, TypeChecker | |Assignee | None | |Priority | Medium | md5: 7b3e32b05c391b343b357d6ddce792e5Issue Description:
Observed Behavior: When a function parameter is a tuple containing one or more closure signatures, pressing Return while its placeholder is highlighted in Xcode's source editor produces incorrect code template expansion. All other parameters in the tuple are ignored. If the closure signatures have an empty (()) input pattern, then only the first closure found is expanded. If the the closures expect an input value, then those input values are erroneously aggregated and applied to a single expanded closure.
Expected behavior: The expansion should expand the tuple's signature completely, and for any closures it encounters it should produce fully labelled and parameterized closure structures.
Example 1:
incorrectly expands as:
but should expand as:
Example 2:
incorrectly expands as:
but should expand as: