shithub: mc

ref: 30ae6dbd5eb7c7f8c9c76a32723dd33c5f90978b
dir: /test/matchunion.myr/

View raw version
use std
/* checks that union matching works, at least on the key.
exits with 84. */
type u = union
	`Foo
	`Bar
	`Baz
	`Quux
;;

const main = {
	var v

	v = `Foo
	match v
	`Bar:
		-> 42
		;;
	`Baz:
		-> 81
		;;
	`Foo:
		-> 84
		;;
	`Quux:
		-> 123
		;;
	;;
}