shithub: mc

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

View raw version
use std

type t = struct
	v1 : int
	v2 : int
	v3 : int
;;

const main = {
	var v : t

	v.v1 = 2
	v.v2 = 40
	v.v3 = 10
	match v
	[.v1 = x,
	 .v2 = y,
	 .v3 = 10]:	
		 -> x + y
		 ;;
	_:	std.die("Wat");;
	;;
	-> 0
}