summaryrefslogtreecommitdiff
path: root/test/generictype.myr
blob: 68a6508f121ee9be8f46912d12402b474f2c27a1 (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)) = union
	`Some @a::(integral,numeric)
	`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)
}