-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathtypes_test.cw
47 lines (33 loc) · 871 Bytes
/
types_test.cw
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
module:
wrapped type t1 = s32
wrapped type t2 = void
wrapped type t3 = void
pub rec type_rec:
; this is a comment with \" with quotes \t
s1 s32
s2 s32
s3 s32
s4 s32
b1 bool
u1 u64
u2 u64
pub rec linked_list:
; this is a comment with \" with quotes \t
s1 union(void, ^linked_list)
pub enum type_enum s32:
; this is a comment with \" with quotes \t
s1 auto
s2 auto
s3 auto
s4 auto
type type_array = [3]bool
type type_slice = span(type_rec)
type type_ptr = ^!s32
pub type type_union = union(s32, void, type_ptr)
pub type type_union2 = union(s32, void, union(type_union, u8))
type type_fun = funtype(a bool, b bool, c s32) s32
fun funx(a type_union) s32:
return narrow_as(a, union_delta(type_union, union(void, type_ptr)))
; just a compilation test
fun main(argc s32, argv ^^u8) s32:
return 0