summaryrefslogtreecommitdiff
path: root/test/empty-struct.myr
blob: a3ec75a812c4d510b0d1a20b6f999f1eb7b945fc (plain)
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
use std

type foo = struct
;;

type bar = struct
        baz : foo[:]
        quux : foo[0][:]
;;


const main = {
        var a : foo
        var z : foo[0]
        var b : bar = [.baz = [a, a][:], .quux = [z, z, z][:]]
        var c : int = 0
        for f in b.baz
                c += 3
        ;;

        for f in b.quux
                c += 5
        ;;

        std.exit(c)
}