summaryrefslogtreecommitdiff
path: root/tiger-compiler/tests/good/record-set-to-nil.tig
blob: bf544ccbc7f4ed6a7c71d91bcea36a6b0edf57a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
let
    type rec = { text: string, value: int }
    var test: rec := nil
in
    if (test = nil) then
        1
    else
        0;

    test := rec { text = "key", value = 0 };

    if ( test.value = 1 ) then
        -1
    else
        100;

    test := nil;

    if (test = nil) then
        1
    else
        0
end