Debian Codegraph @

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

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