| 1 |
package foo:records; |
| 2 |
|
| 3 |
interface records { |
| 4 |
record single { |
| 5 |
f: u8, |
| 6 |
} |
| 7 |
|
| 8 |
record scalars { |
| 9 |
a: u32, |
| 10 |
b: u32, |
| 11 |
} |
| 12 |
|
| 13 |
flags really-flags { |
| 14 |
a, |
| 15 |
b, |
| 16 |
c, |
| 17 |
d, |
| 18 |
e, |
| 19 |
f, |
| 20 |
g, |
| 21 |
h, |
| 22 |
i, |
| 23 |
} |
| 24 |
|
| 25 |
record aggregates { |
| 26 |
a: scalars, |
| 27 |
b: u32, |
| 28 |
c: single, |
| 29 |
d: string, |
| 30 |
e: really-flags, |
| 31 |
} |
| 32 |
|
| 33 |
type int-typedef = s32; |
| 34 |
|
| 35 |
type tuple-typedef2 = tuple<int-typedef>; |
| 36 |
|
| 37 |
tuple-arg: func(x: tuple<char, u32>); |
| 38 |
|
| 39 |
tuple-result: func() -> tuple<char, u32>; |
| 40 |
|
| 41 |
single-arg: func(x: single); |
| 42 |
|
| 43 |
single-result: func() -> single; |
| 44 |
|
| 45 |
scalar-arg: func(x: scalars); |
| 46 |
|
| 47 |
scalar-result: func() -> scalars; |
| 48 |
|
| 49 |
flags-arg: func(x: really-flags); |
| 50 |
|
| 51 |
flags-result: func() -> really-flags; |
| 52 |
|
| 53 |
aggregate-arg: func(x: aggregates); |
| 54 |
|
| 55 |
aggregate-result: func() -> aggregates; |
| 56 |
|
| 57 |
typedef-inout: func(e: tuple-typedef2) -> s32; |
| 58 |
} |
| 59 |
|
| 60 |
world records-world { |
| 61 |
import records; |
| 62 |
|
| 63 |
export records; |
| 64 |
} |