Merge pull request #9145 from tamasvajk/kotlin-useless-param

Kotlin: Respect `override` modifier in useless parameter query
This commit is contained in:
Tamás Vajk
2022-05-17 08:43:59 +02:00
committed by GitHub
4 changed files with 12 additions and 0 deletions

View File

@@ -302,6 +302,8 @@ class RootdefCallable extends Callable {
exists(MemberRefExpr mre | mre.getReferencedCallable() = this)
or
this.getAnAnnotation() instanceof OverrideAnnotation
or
this.hasModifier("override")
}
}

View File

@@ -0,0 +1,9 @@
interface A<T, V> {
fun setValue(a: T, b: V)
}
class B : A<B, Int> {
override fun setValue(a: B, b: Int) {
println("a")
}
}

View File

@@ -0,0 +1 @@
DeadCode/UselessParameter.ql