Skip to content

Fix unused_parameter for module-selected keyword calls - #6919

Open
thliu21 wants to merge 1 commit into
realm:mainfrom
thliu21:codex/6816-swiftsyntax-release
Open

thliu21 wants to merge 1 commit into
realm:mainfrom
thliu21:codex/6816-swiftsyntax-release

Conversation

@thliu21

@thliu21 thliu21 commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

unused_parameter reports a used parameter as unused, and can remove its name during autocorrection, when it is passed to a module-selected keyword-named function such as Module::as(x) or Module::is(x).

Update the SwiftPM and Bazel SwiftSyntax pins to 605.0.0-prerelease-2026-09-15, which includes the parser fix from @no-hup in swiftlang/swift-syntax#3406. Add separate non-triggering examples for both calls and a changelog entry. Once the parser recognizes these calls, the existing rule correctly tracks the parameter references; no rule algorithm change is needed.

Fixes #6816.

Validation on macOS arm64 with Apple Swift 6.3.2:

  • With the previous June 26 pin, UnusedParameterRuleGeneratedTests fails on the two new examples, including their autocorrection checks. With the new pin, the same test passes.
  • The complete issue reproducer now reports zero violations.
  • swift test --jobs 4: 1,112 tests in 377 suites passed.
  • .build/debug/swiftlint lint --quiet --strict --no-cache: passed.
  • Downloaded the release source archive and verified the Bazel SHA256 and strip prefix.

Xcode, Bazel, and Linux/Docker tests were not run locally and remain for CI.

@SwiftLintBot

Copy link
Copy Markdown
20 Messages
📖 Building this branch resulted in a binary size of 28755.54 KiB vs 28467.96 KiB when built on main (1% larger).
📖 Linting Aerial with this PR took 0.67 s vs 0.69 s on main (2% faster).
📖 Linting Alamofire with this PR took 0.97 s vs 1.0 s on main (3% faster).
📖 Linting Brave with this PR took 5.54 s vs 5.6 s on main (1% faster).
📖 Linting Brigade with this PR took 18.23 s vs 18.05 s on main (0% slower).
📖 Linting DuckDuckGo with this PR took 31.54 s vs 31.94 s on main (1% faster).
📖 Linting Firefox with this PR took 11.64 s vs 11.79 s on main (1% faster).
📖 Linting Kickstarter with this PR took 7.43 s vs 7.5 s on main (0% faster).
📖 Linting Moya with this PR took 0.37 s vs 0.38 s on main (2% faster).
📖 Linting NetNewsWire with this PR took 2.55 s vs 2.59 s on main (1% faster).
📖 Linting Nimble with this PR took 0.56 s vs 0.56 s on main (0% slower).
📖 Linting PocketCasts with this PR took 7.47 s vs 7.54 s on main (0% faster).
📖 Linting Quick with this PR took 0.36 s vs 0.36 s on main (0% slower).
📖 Linting Realm with this PR took 2.97 s vs 3.01 s on main (1% faster).
📖 Linting Sourcery with this PR took 1.63 s vs 1.65 s on main (1% faster).
📖 Linting Swift with this PR took 4.52 s vs 4.6 s on main (1% faster).
📖 Linting SwiftLintPerformanceTests with this PR took 0.19 s vs 0.18 s on main (5% slower).
📖 Linting VLC with this PR took 1.43 s vs 1.44 s on main (0% faster).
📖 Linting Wire with this PR took 16.64 s vs 16.78 s on main (0% faster).
📖 Linting WordPress with this PR took 10.59 s vs 10.69 s on main (0% faster).

Generated by 🚫 Danger

@thliu21

thliu21 commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

I verified that #6931 picked up the parser fix. The original #6816 example now passes lint and is unchanged by --fix. Would you prefer that I keep this PR open with just the two regression examples, or close it as superseded?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants