You've already forked wit-bindgen
mirror of
https://github.com/AdaCore/wit-bindgen.git
synced 2026-02-12 13:12:42 -08:00
* Correct the accounting for results containing empty types. Empty types are special-cased in the C backend because C doesn't allow zero-sized types. In the case of a result containing an empty type, when processing the ok side, increment the return value counter even if the store is omitted due to the value being empty. Fixes #609. * Test all the combinations of non-empty, empty, and absent.
30 lines
605 B
Plaintext
30 lines
605 B
Plaintext
package local:demo
|
|
|
|
interface my-interface {
|
|
variant stuff {
|
|
this,
|
|
that
|
|
}
|
|
|
|
record empty {
|
|
}
|
|
|
|
stuff-or-stuff: func() -> result<stuff, stuff>
|
|
stuff-or-empty: func() -> result<stuff, empty>
|
|
empty-or-stuff: func() -> result<empty, stuff>
|
|
empty-or-empty: func() -> result<empty, empty>
|
|
|
|
stuff-or-absent: func() -> result<stuff>
|
|
absent-or-stuff: func() -> result<_, stuff>
|
|
|
|
empty-or-absent: func() -> result<empty>
|
|
absent-or-empty: func() -> result<_, empty>
|
|
|
|
absent-or-absent: func() -> result
|
|
}
|
|
|
|
|
|
world my-world {
|
|
import my-interface
|
|
}
|