aboutsummaryrefslogtreecommitdiff
path: root/test/optionals.tm
blob: 5f6fb78a084eb1feb95024b633a49cfd67413012 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

func main():
    >> opt := @5?
    when opt is @nonnull:
        >> nonnull[]
        = 5
    else:
        fail("Oops")

    >> opt = !@Int
    when opt is @nonnull:
        fail("Oops")
    else:
        >> opt
        = !Int