Debian Codegraph @

crates/wit-parser/tests/ui/types.wit

raw
1 package foo:types;
2
3 interface types {
4 type t1 = u8;
5 type t2 = u16;
6 type t3 = u32;
7 type t4 = u64;
8 type t5 = s8;
9 type t6 = s16;
10 type t7 = s32;
11 type t8 = s64;
12 type t9a = f32;
13 type t9b = f32;
14 type t10a = f64;
15 type t10b = f64;
16 type t11 = char;
17 type t12 = list<char>;
18 type t13 = string;
19 type t14 = option<u32>;
20 type t15 = result<u32, u32>;
21 type t16 = result<_, u32>;
22 type t17 = result<u32>;
23 type t18 = result;
24 record t20 {}
25 record t21 { a: u32 }
26 record t22 { a: u32, }
27 record t23 { a: u32, b: u64 }
28 record t24 { a: u32, b: u64, }
29 record t25 { x: u32 }
30 record %record {}
31 type t26 = tuple<>;
32 type t27 = tuple<u32>;
33 type t28 = tuple<u32,>;
34 type t29 = tuple<u32, u64>;
35 flags t30 {}
36 flags t31 { a, b, c }
37 flags t32 { a, b, c, }
38 variant t33 { a }
39 variant t34 { a, b }
40 variant t35 { a, b, }
41 variant t36 { a, b(u32), }
42 variant t37 { a, b(option<u32>), }
43 enum t41 { a, b, c }
44 enum t42 { a, b, c, }
45 type t43 = bool;
46 type t44 = string;
47 type t45 = list<list<list<t32>>>;
48 type t46 = t44;
49 type t47 = %t44;
50 type t48 = stream<u32>;
51 type t49 = future<u32>;
52 type t50 = future;
53 type t51a = list<u32, 4>;
54 type t51b = list<list<u32, 4>, 2>;
55
56 /// type order doesn't matter
57 type foo = bar;
58 type bar = u32;
59 }