shithub: mc

ref: 53f937aeaa1ad2320f61c63933e24f2f6f1f326f
dir: /test/genericmake.myr/

View raw version
use std

type t(@ty) = union
	`Some @ty
	`None
;;

const make = {v
	-> `Some v
}

const main = {
	var x

	x = make(123)
	match x
	| `std.Some v:	std.put("val = %i\n", v)
	| `std.None:	std.die("Unreachable\n")
	;;
}