File: LubIndex.java

package info (click to toggle)
checker-framework-java 3.2.0%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 23,104 kB
  • sloc: java: 145,916; xml: 839; sh: 518; makefile: 404; perl: 26
file content (44 lines) | stat: -rw-r--r-- 1,252 bytes parent folder | download | duplicates (3)
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;
    }
}