1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
import org.checkerframework.common.value.qual.BottomVal;
import org.checkerframework.common.value.qual.MinLen;
public class LubIndex {
public static void MinLen(int @MinLen(10) [] arg, int @MinLen(4) [] arg2) {
int[] arr;
if (true) {
arr = arg;
} else {
arr = arg2;
}
// :: error: (assignment.type.incompatible)
int @MinLen(10) [] res = arr;
int @MinLen(4) [] res2 = arr;
// :: error: (assignment.type.incompatible)
int @BottomVal [] res3 = arr;
}
public static void Bottom(int @BottomVal [] arg, int @MinLen(4) [] arg2) {
int[] arr;
if (true) {
arr = arg;
} else {
arr = arg2;
}
// :: error: (assignment.type.incompatible)
int @MinLen(10) [] res = arr;
int @MinLen(4) [] res2 = arr;
// :: error: (assignment.type.incompatible)
int @BottomVal [] res3 = arr;
}
public static void BothBottom(int @BottomVal [] arg, int @BottomVal [] arg2) {
int[] arr;
if (true) {
arr = arg;
} else {
arr = arg2;
}
int @MinLen(10) [] res = arr;
int @BottomVal [] res2 = arr;
}
}
|