aboutsummaryrefslogtreecommitdiff
path: root/tests/ptr.ek
blob: 86f413c2fdf011e3a6ec22e73bac5b101e6ee507 (plain) (blame)
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
typedef bool {}

typedef i27 {
	cmp![];
	eq(i27 a, i27 b => bool) {
		return a == b;
	}
}

typedef ptr {
	cmp![];
	eq(ptr a, ptr b => bool) {
		return a == b;
	}
}

typedef test[cmp T] {}

define cmp[] {
	eq(cmp, cmp => bool);
}

main()
{
	const a = test![i27]{};
	20.eq(20);

	const b = test![*i27]{};
	a&.eq(a&);
}