v4 / vlib / v / checker / tests / match_expr_else.vv
41 lines · 40 sloc · 347 bytes · 0c8ce3bcb9fd4a2e5bd5f991a5a07da976d780d7
Raw
1type AA = int | string | f64
2
3fn main() {
4 x := AA('test')
5 _ = match x {
6 int {
7 'int'
8 }
9 string {
10 'string'
11 }
12 }
13 _ = match x {
14 int {
15 'int'
16 }
17 string {
18 'string'
19 }
20 f64 {
21 'f64'
22 }
23 else {
24 'else'
25 }
26 }
27 _ = match x {
28 int {
29 'int'
30 }
31 string {
32 'string'
33 }
34 f64 {
35 'f64'
36 }
37 else {
38 'else'
39 }
40 }
41}
42