1(use "errno.witx")
2(use "excuse.witx")
3
4(typename $reason
5  (variant (@witx tag $excuse)
6    (case $dog_ate f32)
7    (case $traffic s32)
8    (case $sleeping)))
9
10(typename $reason_mut
11  (variant (@witx tag $excuse)
12    (case $dog_ate (@witx pointer f32))
13    (case $traffic (@witx pointer s32))
14    (case $sleeping)))
15
16(module $variant_example
17  (@interface func (export "get_tag")
18    (param $r $reason)
19    (result $error (expected $excuse (error $errno)))
20  )
21
22  (@interface func (export "reason_mult")
23    (param $r $reason_mut)
24    (param $multiply_by u32)
25    (result $error (expected (error $errno)))
26  )
27)
28