mirror of
https://github.com/github/codeql.git
synced 2025-12-20 10:46:30 +01:00
Kotlin permits introducing a `? extends ...` wildcard against an Array even though the class is final, so long as its argument itself can be extended (i.e. isn't final or is another array type satisfying this condition). Contravariant arrays get lowered to Object[], and are subject to automatic `extends` wildcard introduction, unless their element type was already Any.
14 lines
410 B
Plaintext
14 lines
410 B
Plaintext
import java
|
|
|
|
class InterestingMethod extends Method {
|
|
InterestingMethod() { this.getDeclaringType().getName() = "TakesArrayList" }
|
|
}
|
|
|
|
query predicate broken(string methodName) {
|
|
methodName = any(InterestingMethod m).getName() and
|
|
count(Type t, InterestingMethod m | methodName = m.getName() and t = m.getAParamType() | t) != 1
|
|
}
|
|
|
|
from InterestingMethod m
|
|
select m.getName(), m.getAParamType().toString()
|