mirror of
https://github.com/github/codeql.git
synced 2025-12-22 03:36:30 +01:00
Kotlin: do not report on unused object extension parameters
This commit is contained in:
@@ -281,7 +281,12 @@ class RootdefCallable extends Callable {
|
||||
Parameter unusedParameter() {
|
||||
exists(int i | result = this.getParameter(i) |
|
||||
not exists(result.getAnAccess()) and
|
||||
not overrideAccess(this, i)
|
||||
not overrideAccess(this, i) and
|
||||
// Do not report unused parameters on extension parameters that are (companion) objects.
|
||||
not (
|
||||
result.isExtensionParameter() and
|
||||
(result.getType() instanceof CompanionObject or result.getType() instanceof ClassObject)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user