squash all tagged union work into one commit

This commit is contained in:
Pat Hickey
2020-02-20 14:36:53 -08:00
committed by Jakub Konka
parent 25a411d7fd
commit f6a732b6cf
5 changed files with 297 additions and 12 deletions

28
tests/union.witx Normal file
View File

@@ -0,0 +1,28 @@
(use "errno.witx")
(use "excuse.witx")
(typename $reason
(union $excuse
(field $dog_ate f32)
(field $traffic s32)
(empty $sleeping)))
(typename $reason_mut
(union $excuse
(field $dog_ate (@witx pointer f32))
(field $traffic (@witx pointer s32))
(empty $sleeping)))
(module $union_example
(@interface func (export "get_tag")
(param $r $reason)
(result $error $errno)
(result $t $excuse)
)
(@interface func (export "reason_mult")
(param $r $reason_mut)
(param $multiply_by u32)
(result $error $errno)
)
)