Repository navigation
Unified, Swift: Translate ignored parameters into ignore patterns - #23050
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 49ef7786-959a-40d6-861f-3dcd71a73665
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 49ef7786-959a-40d6-861f-3dcd71a73665
paldepind
force-pushed
the
unified/anonymous-identifier
branch
from
November 9, 2026 09:04
ae7d1a3 to
fbef21d
Compare
paldepind
marked this pull request as ready for review
November 9, 2026 09:31
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the change to represent anonymous Swift parameters as ignore patterns.
No open issues 🎉
What changed in this PR
This PR updates the unified Swift extractor to represent anonymous local parameters (_) as ignore patterns rather than identifiers, matching Swift’s parameter semantics.
Changes:
- Applies shared parameter-pattern translation to functions and typed and shorthand closures.
- Adds coverage for anonymous parameters, including those with external argument labels.
- Updates existing expected outputs to reflect ignore patterns.
| File | Description |
|---|---|
unified/extractor/tests/corpus/swift/types/function-type-with-inout-parameter.output |
Updates the expected anonymous closure parameter pattern. |
unified/extractor/tests/corpus/swift/functions/function-with-anonymous-parameters.swift |
Adds anonymous function and closure parameter cases. |
unified/extractor/tests/corpus/swift/functions/function-with-anonymous-parameters.output |
Records expected translation for the new cases. |
unified/extractor/tests/corpus/swift/expressions/array-type-constructor.output |
Updates the ignored closure parameter expectation. |
unified/extractor/src/languages/swift/swift.rs |
Adds and applies shared translation from _ parameters to ignore patterns. |
Review effort: Balanced (auto)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In Swift parameters that are named
_are ignored and not accessible within the body of the function: https://docs.swift.org/latest/documentation/the-swift-programming-language/declarations/#Special-Kinds-of-ParametersThis PR translates such anonymous local parameter names to ignore patterns instead of identifiers.