aboutsummaryrefslogtreecommitdiff
path: root/tests/structs.ek
blob: 22cce710652d626256046424e8b72cb6cb4434ae (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
typedef i27 {}
typedef i9 {}

typedef int_pair {
	i27 a;
	i27 b;

	sum(*int_pair self => i27)
	{
		return self*.a + self*.b;
	}
}

main()
{
	mut p = int_pair!{.a = 9, .b = 10};
	i27 s = p.sum();
}