shithub: mc

ref: ff88594df5c5df6fb8f227ab8e5df3529ba6e72f
dir: /test/nestucon.myr/

View raw version
use std

type t = struct
	x : union
		`Int int
		`Str byte[:]
	;;
;;

const main = {
	var a : t

	a = [.x = `Str "asdf"]
	match a
	| [.x=`Str s]:	std.put("{}\n", s)
	| _:	std.die("Impossible match failure\n")
	;;
}