nx_probe_match_plain.nx source
↩ module page · 16 lines · 483 B
1// nx_probe_match_plain.nx -- isolate: does PLAIN-enum match (no payload)
2// run correctly? Narrows the SIGSEGV in nx_probe_match to either the
3// plain dispatch or the tagged-payload path.
4// expect_exit: 0 (c = Color::Green -> Green arm -> return 0)
5
6enum Color { Red, Green, Blue }
7
8func main() -> i64 {
9 let c: i64 = Color::Green
10 match c {
11 Color::Red => { return 1 },
12 Color::Green => { return 0 },
13 Color::Blue => { return 3 }
14 }
15 return 9
16}