shithub: mc

ref: 78da203b42b5084a7664e8773f418a4730184d53
dir: /test/generictype.myr/

View raw version
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)
}