Unified: Extract modifiers for function declarations - #22540
Open
hvitved wants to merge 2 commits into
Open
Conversation
Capture declaration modifiers on Swift functions with and without bodies, and add corpus coverage for consuming, static, and class functions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The newly modified bodyless-function branch lacks modifier-focused corpus coverage.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 1
New issues introduced by this change (1)
| Severity | Finding |
|---|---|
unified/extractor/src/languages/swift/swift.rs — This bodyless-function branch now propagates modifiers, but the added static/class fixtures and… |
What changed in this PR
Adds Swift function modifiers to unified AST function declarations.
Changes:
- Propagates modifiers for functions with and without bodies.
- Adds corpus coverage for
static,class, and existingconsumingfunctions.
| File | Description |
|---|---|
unified/extractor/src/languages/swift/swift.rs |
Emits function declaration modifiers. |
unified/extractor/tests/corpus/swift/types/static-function.swift |
Adds a static-function fixture. |
unified/extractor/tests/corpus/swift/types/static-function.output |
Records static modifier output. |
unified/extractor/tests/corpus/swift/types/class-function.swift |
Adds a class-function fixture. |
unified/extractor/tests/corpus/swift/types/class-function.output |
Records class modifier output. |
unified/extractor/tests/corpus/swift/control-flow/discard-statement.output |
Records the consuming modifier. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
hvitved
marked this pull request as ready for review
September 10, 2026 11:36
Contributor
Author
|
I'll hold this back until #22498 is merged, to avoid further merge conflicts on that PR. |
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.

Swift function declaration modifiers were omitted from the unified AST, preventing consumers from distinguishing declarations such as
consuming,static, andclassfunctions.Capture the
functionDecl.modifiersfield for functions both with and without bodies, and emit the translated modifiers onfunction_declaration. Add focused corpus coverage forstaticandclassfunctions, while updating the existingconsumingfunction corpus output.