mirror of
https://github.com/github/codeql.git
synced 2025-12-23 04:06:37 +01:00
Add test verifying no malformed wildcards result from captured type variables with a Collection<? extends ...> type
This commit is contained in:
@@ -0,0 +1,13 @@
|
|||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
public class Test {
|
||||||
|
|
||||||
|
public Collection<? extends CharSequence> getCollection() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void test() {
|
||||||
|
this.getCollection().isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
import java
|
||||||
|
|
||||||
|
from Method m, Type t
|
||||||
|
where m.getAParamType() = t and t.toString().matches("%? super ? extends%")
|
||||||
|
select m, t
|
||||||
Reference in New Issue
Block a user