summaryrefslogtreecommitdiff
path: root/test/nestucon.myr
blob: 747ca59bd123bb90ed7999568cff835b8ea0bd14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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")
	;;
}