shithub: mc

ref: 02201160614e5f25a7a73d86ed26a1f90fa4f5bb
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")
	;;
}