summaryrefslogtreecommitdiff
path: root/test/generictype.myr
blob: 3e62af442db14a02d4a0446046fffee7dd6b64d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use std

/* checks that parameterized types work. exits with 0. */
type option(@a) :: integral,numeric @a = union
	`Some @a
	`None
;;

const main = {
	var v

	v = `Some 123
	match v
	| `None:	std.exit(1)
	| `Some 123:	std.exit(0)
	| `Some _:	std.die("Impossible match failure\n")
	;;
	std.exit(60)
}