blob: f926774c9b8407b636673f04d421b03b5a2ed51c [file] [log] [blame]
package index;
import org.checkerframework.checker.index.qual.IndexFor;
@SuppressWarnings("upperbound")
public class IndexForTestLBC {
int[] array = {0};
void test1(@IndexFor("array") int i) {
int x = this.array[i];
}
void callTest1(int x) {
test1(0);
test1(1);
test1(2);
test1(array.length);
// :: error: (argument)
test1(array.length - 1);
if (array.length > x) {
// :: error: (argument)
test1(x);
}
if (array.length == x) {
test1(x);
}
}
}