summaryrefslogtreecommitdiff
path: root/examples/03-sum/src/shapes.hob
blob: 03a727a1be5a5ff5ed74a09931337b245e23edd3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/// A 2D shape.
sum Shape {
    variant Rectangle;
    variant Triangle;

    field width: Int32;
}

struct Rectangle {
    field width: Int32;
    field height: Int32;
}

struct Triangle {
    field width: Int32;
    field height: Int32;
}