Debian Codegraph @

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

raw
1 package foo:bar;
2
3 interface foo {
4 resource a {
5 }
6
7 resource b {
8 constructor();
9 }
10
11 resource c {
12 constructor(x: u32);
13 }
14
15 resource d {
16 constructor(x: u32);
17
18 a: func();
19
20 b: static func();
21 }
22
23 resource e {
24 constructor(other: own<e>, other2: borrow<e>);
25
26 method: func(thing: own<e>, thing2: borrow<e>);
27 }
28
29 resource f {
30 constructor() -> result<f>;
31 }
32
33 resource g {
34 constructor() -> result<g, string>;
35 }
36 }
37
38 world w {
39 resource a;
40
41 resource b {
42 }
43
44 resource c {
45 constructor();
46 }
47 }
48
49 interface i {
50 resource a;
51
52 type t1 = a;
53 type t2 = borrow<a>;
54 type t3 = borrow<t1>;
55 }