Files
wit-bindgen/tests/codegen/records.wit
Alex Crichton a2935a4fa4 Update wit-bindgen for upcoming WIT changes (#580)
* Update Rust codegen for new WIT changes

* Update the markdown generation for new WIT

* more-rust

* Update the C generator for new WIT

* Get Rust guest tests compiling

* Get rust host tests working

* Get all C tests passing

* Turn off teavm-java and Go tests for now

* Fixup lockfile after rebase

* Bump crate versions

* Update dependency sources

* Update to wasmtime dep
2023-05-26 12:30:24 -05:00

62 lines
1.2 KiB
Plaintext

package foo:foo
interface records {
tuple-arg: func(x: tuple<char, u32>)
tuple-result: func() -> tuple<char, u32>
record empty {}
empty-arg: func(x: empty)
empty-result: func() -> empty
/// A record containing two scalar fields
/// that both have the same type
record scalars {
/// The first field, named a
a: u32,
/// The second field, named b
b: u32,
}
scalar-arg: func(x: scalars)
scalar-result: func() -> scalars
/// A record that is really just flags
/// All of the fields are bool
record really-flags {
a: bool,
b: bool,
c: bool,
d: bool,
e: bool,
f: bool,
g: bool,
h: bool,
i: bool,
}
flags-arg: func(x: really-flags)
flags-result: func() -> really-flags
record aggregates {
a: scalars,
b: u32,
c: empty,
d: string,
e: really-flags,
}
aggregate-arg: func(x: aggregates)
aggregate-result: func() -> aggregates
type tuple-typedef = tuple<s32>
type int-typedef = s32
type tuple-typedef2 = tuple<int-typedef>
typedef-inout: func(e: tuple-typedef2) -> s32
}
world the-world {
import records
export records
}