aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/eolian/data/enum.eo
blob: 4275b245676dae077de7393b5f4998b5e190beb4 (plain) (blame)
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
45
// regular named enum
enum Foo {
    first,
    bar,
    baz = 5 * 3
}

enum Bar {
    legacy: test;
    foo = Foo.baz
}

enum Baz {
    flag1 = 1 << 0,
    flag2 = 1 << 1,
    flag3 = 1 << 2, // testing trailing comma on last item
}

enum Name.Spaced {
    pants
}

const Bah: Baz = Baz.flag1;

enum Value {
    foo,
    bar,
    baz = 2,
    bah,
    bam,
    pants
}

const Pants: Value = Value.pants;

class Enum {
    methods {
        foo {
            params {
                idx: int;
            }
            return: string @owned;
        }
    }
}