Skip to content

Commit e877967

Browse files
committed
Add test verifying no malformed wildcards result from captured type variables with a Collection<? extends ...> type
1 parent d999c1d commit e877967

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import java.util.Collection;
2+
3+
public class Test {
4+
5+
public Collection<? extends CharSequence> getCollection() {
6+
return null;
7+
}
8+
9+
public void test() {
10+
this.getCollection().isEmpty();
11+
}
12+
13+
}

java/ql/test/library-tests/wildcards-and-captured-types/test.expected

Whitespace-only changes.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import java
2+
3+
from Method m, Type t
4+
where m.getAParamType() = t and t.toString().matches("%? super ? extends%")
5+
select m, t

0 commit comments

Comments
 (0)