Debian Codegraph @

framework/tests/value-ignore-range-overflow/RefinementNEq.java

raw
1 import org.checkerframework.common.value.qual.IntRange;
2
3 public class RefinementNEq {
4
5 void test_not_equal(int a, int j, int s) {
6
7 // :: error: (assignment.type.incompatible)
8 @IntRange(from = 0) int aa = a;
9 if (-1 != a) {
10 // :: error: (assignment.type.incompatible)
11 @IntRange(from = -1) int b = a;
12 } else {
13 @IntRange(from = -1) int c = a;
14 }
15
16 if (0 != j) {
17 // :: error: (assignment.type.incompatible)
18 @IntRange(from = 0) int k = j;
19 } else {
20 @IntRange(from = 0) int l = j;
21 }
22
23 if (1 != s) {
24 // :: error: (assignment.type.incompatible)
25 @IntRange(from = 1) int t = s;
26 } else {
27 @IntRange(from = 1) int u = s;
28 }
29 }
30 }