mirror of
https://github.com/github/codeql.git
synced 2025-12-19 10:23:15 +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.
12 lines
242 B
Java
12 lines
242 B
Java
public class User {
|
|
|
|
public static void test() {
|
|
|
|
TakesArrayList tal = new TakesArrayList();
|
|
tal.invarArray(null);
|
|
// Using one method suffices to get the extractor to describe all the methods defined on takesArrayList.
|
|
|
|
}
|
|
|
|
}
|