Skip to content

Commit d6b001e

Browse files
authored
Add case for TypeVar and Array
1 parent 5e81dcf commit d6b001e

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

framework/src/main/java/org/checkerframework/framework/type/AsSuperVisitor.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,12 @@ private AnnotatedTypeMirror visitTypevar_NotTypevarNorWildcard(
598598
return copyPrimaryAnnos(type, asSuper);
599599
}
600600

601+
@Override
602+
public AnnotatedTypeMirror visitTypevar_Array(
603+
AnnotatedTypeVariable type, AnnotatedArrayType superType, Void p) {
604+
return visitTypevar_NotTypevarNorWildcard(type, superType, p);
605+
}
606+
601607
@Override
602608
public AnnotatedTypeMirror visitTypevar_Declared(
603609
AnnotatedTypeVariable type, AnnotatedDeclaredType superType, Void p) {
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package open.caughtcrash;
2+
3+
import java.util.Collection;
4+
import java.util.Comparator;
5+
import java.util.Map;
6+
7+
public class Issue6874 {
8+
public static void test(Comparator<Map[]> x, Collection<Map[]> y, Collection<? extends Map[]> z) {
9+
java.util.Collections.min((true) ? y : z, x);
10+
}
11+
}

0 commit comments

Comments
 (0)