You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
unused_parameter spurious violation for parameters used in calls to raw identifier functions whose name is a keyword, when prefixed with Swift 6.3 module selector #6816
unused_parameter reports a spurious violation for parameters used in calls to a function whose name is the same as a keyword (achieved via raw identifiers) when, and only when, prefixed with a Swift 6.3 module selector:
Note: since module selectors are relatively new, there might be other bugs involving them.
func`as`(_:Int){}func`is`(_:Int){}func`a`(_:Int){}funcviolation(_x:Int){ // violation: Parameter 'x' is unused
Module::as(x)Module::is(x)}funcnoViolation1(_x:Int){Module::a(x)}funcnoViolation2(_x:Int){`as`(x)}funcnoViolation3(_x:Int){`is`(x)}funcnoViolation4(_x:Int){Module.as(x)}funcnoViolation5(_x:Int){Module.is(x)}
I could not find an existing upstream tracker, so I reproduced this against SwiftSyntax main as well as SwiftLint 0.65.0 and opened swiftlang/swift-syntax#3387.
Module::as(x) and Module::is(x) are currently parsed as UnexpectedCodeDeclSyntax, so x never reaches unused_parameter as a reference. The mismatch is in atStartOfExpression(): it rejects the keyword after consuming the module selector even though parseDeclReferenceBase() supports that form.
A small local parser fix plus regression tests passes all 19 ModuleSelectorTests. I will follow up with the upstream fix there.
Activity
SimplyDanny commentedon Jul 10, 2026
Waiting for SwiftSyntax to support module selectors in combination with raw identifiers.
rgoldberg commentedon Jul 11, 2026
Has that been reported to Apple/SwiftLang? Is there any issue tracking for it or ETA for its completion?
Thanks for any info.
thliu21 commentedon Jul 22, 2026
I could not find an existing upstream tracker, so I reproduced this against SwiftSyntax
mainas well as SwiftLint 0.65.0 and opened swiftlang/swift-syntax#3387.Module::as(x)andModule::is(x)are currently parsed asUnexpectedCodeDeclSyntax, soxnever reachesunused_parameteras a reference. The mismatch is inatStartOfExpression(): it rejects the keyword after consuming the module selector even thoughparseDeclReferenceBase()supports that form.A small local parser fix plus regression tests passes all 19
ModuleSelectorTests. I will follow up with the upstream fix there.