Skip to content

[6.0] [Completion] A couple of trailing closure fixes #74204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

hamishknight
Copy link
Contributor

6.0 cherry-pick of #74191

  • Explanation: Fixes a couple of completion issues around multiple trailing closures
  • Scope: Affects completion logic for call patterns around multiple trailing closures
  • Issue: rdar://127760308
  • Risk: Low, the fixes are straightforward
  • Testing: Added tests to test suite
  • Reviewer: Alex Hoppen

Completing call argument patterns here is invalid.

rdar://127760308
`Res.FirstTrailingClosureIndex` is an index into
the argument list, so comparing it against a
parameter index is wrong. Instead, compare it
against the argument index of the completion token,
which is what we want to be checking. This ensures
we don't try and offer argument completions for
non-function default arguments.

rdar://127760308
@hamishknight hamishknight added 🍒 release cherry pick Flag: Release branch cherry picks swift 6.0 labels Jun 7, 2024
@hamishknight hamishknight requested a review from bnbarham June 7, 2024 10:42
@hamishknight hamishknight requested a review from a team as a code owner June 7, 2024 10:42
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight hamishknight merged commit a7082ba into swiftlang:release/6.0 Jun 7, 2024
5 checks passed
@hamishknight hamishknight deleted the trailing-closure-complete-6.0 branch June 7, 2024 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants