shithub: mc

ref: 84d4511320ac7ca25acb9d5ca449d5a0fcb1f246
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("%s\n", s)
	| _:	std.die("Impossible match failure\n")
	;;
}