summaryrefslogtreecommitdiff
path: root/notes/uninit_data.txt
blob: 5747436d643c4aa8bbd0f48f653edf5e864c801c (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


type Thing = (
    int a
    int when(a>2) b
)

func f() return ref takeown Thing
{
    rwref Thing ret = alloc()
    ret.a = 3
    # b does not need to be initialized!
    return ret
}

func g() return ref takeown Thing
{
    rwref Thing ret = f()
    # FIXME how to resolve this!
    --ret.a
    return ret
}

---

or use some kind of (special?) enum type?