aboutsummaryrefslogtreecommitdiff
path: root/compiler/tests/verifier/type_compat_optional.bad
blob: 1e2b37e655c1a1494c337603479357edb6bf6893 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

() test() {
    
    var int a = 1;
    /* ERRORS only pointer types are compatible without "makeopt" */
    var int? b = 2;
    var int?? c = b;
    b = a;
    c = a;
    b = 3;
    c = 4;
    c? = 5;
    
    var int^? p = @a;
    var int^ q = p; // ERROR assigning optional type to non-optional type
    
    var (int^? x) optstruct = (@a,);
    var (int^ x) ptrstruct;
    
    ptrstruct = optstruct; // ERROR
}