summaryrefslogtreecommitdiff
path: root/test/matchconst.myr
blob: f7a20d1cd03266651d93f2649d97454be909611d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use std
/* checks that matching works when comparing against constants,
instead of just literals. exits with 88. */
/* some misc constants */
const Ca = 123
const Cb = 8
const Cc = 42

const main = {
	var v

	v = 8
	match v
	| Ca: 	std.exit(123)
	| Cb:	std.exit(88)
	| Cc:	std.exit(42)
	| _:	std.die("Impossible match failure in pattern\n")
	;;
}