Repository navigation
Expand file tree
/
Copy pathedge.wit
More file actions
79 lines (70 loc) · 1.52 KB
/
Copy pathedge.wit
File metadata and controls
79 lines (70 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// C# naming and type cases checked by EdgeTests.cs.
package test:edge;
interface types {
record r { r: u8, to-string: u8 }
record p { x: u32 }
type q = p;
type l = list<q>;
record lists { id: u32, names: list<string>, pair: tuple<u8, list<u8>> }
variant v { none, class(string), items(list<u32>), value(u8) }
}
interface ops {
use types.{r, l, lists, v};
keyword: func(class: r) -> r;
alias: func(x: l) -> l;
nested-lists: func(x: lists) -> lists;
cases: func(x: v) -> v;
single: func(x: tuple<u16>) -> tuple<u16>;
}
// Imported and exported, so its types have two copies.
interface shared {
record s { x: u32 }
echo: func(x: s) -> s;
finalize: func();
to-string: func() -> u32;
}
interface %world {
w: func();
}
world edge {
import test:dep/[email protected];
import test:dep/[email protected];
import shared;
import a:b-c/types;
import a-b:c/types;
export ops;
export shared;
export shared: func();
export %world;
export other: interface {
g: func();
}
export register-imports: interface {
r: func();
}
export edge-component: interface {
c: func();
}
}
package a:b-c {
interface types {
f: func() -> u8;
}
}
package a-b:c {
interface types {
g: func() -> u8;
}
}
package test:[email protected] {
interface t {
record r { x: u32 }
f: func(x: r) -> u32;
}
}
package test:[email protected] {
interface t {
record r { x: u32 }
f: func(x: r) -> u32;
}
}