shithub: mc

ref: 905f4d10a78e7e2f6eb849cf373b14cd78c87d73
dir: /test/infer-named.myr/

View raw version
use std

type u = union
	`Foo
	`Bar int
;;

const f = {v : int -> u
	-> `Bar v
}

const main = {
	var v

	v = f(99)
	match v
	| `Foo:		std.exit(1)
	| `Bar x:	std.exit(x)
	;;
	std.exit(2)
}