shithub: mc

ref: 3e9fc44da6d6f27d911211d6b8fbced97c0b4812
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
	| [.v2 = x, .v1 = y, .v3 = 10]:	
		 std.exit(x + y)
	| _:
		std.die("Wat")
	;;
	std.exit(0)
}