1package foo:foo; 2 3interface records { 4 tuple-arg: func(x: tuple<char, u32>); 5 tuple-result: func() -> tuple<char, u32>; 6 7 record empty {} 8 9 empty-arg: func(x: empty); 10 empty-result: func() -> empty; 11 12 /// A record containing two scalar fields 13 /// that both have the same type 14 record scalars { 15 /// The first field, named a 16 a: u32, 17 /// The second field, named b 18 b: u32, 19 } 20 21 scalar-arg: func(x: scalars); 22 scalar-result: func() -> scalars; 23 24 /// A record that is really just flags 25 /// All of the fields are bool 26 record really-flags { 27 a: bool, 28 b: bool, 29 c: bool, 30 d: bool, 31 e: bool, 32 f: bool, 33 g: bool, 34 h: bool, 35 i: bool, 36 } 37 38 flags-arg: func(x: really-flags); 39 flags-result: func() -> really-flags; 40 41 record aggregates { 42 a: scalars, 43 b: u32, 44 c: empty, 45 d: string, 46 e: really-flags, 47 } 48 49 aggregate-arg: func(x: aggregates); 50 aggregate-result: func() -> aggregates; 51 52 type tuple-typedef = tuple<s32>; 53 type int-typedef = s32; 54 type tuple-typedef2 = tuple<int-typedef>; 55 typedef-inout: func(e: tuple-typedef2) -> s32; 56 57 record futures-and-streams { 58 a: future<u8>, 59 b: stream<u8>, 60 c: stream<future<stream>>, 61 d: future<stream<future>>, 62 } 63} 64 65world the-world { 66 import records; 67 export records; 68} 69