aboutsummaryrefslogtreecommitdiff
path: root/v_windows/v/vlib/v/checker/tests/match_expr_else.vv
blob: 7c5551e2e1659088494a980de333924c089fb8d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
type AA = int | string | f64

fn main() {
	x := AA('test')
	_ = match x {
		int {
			'int'
		}
		string {
			'string'
		}
	}
	_ = match x {
		int {
			'int'
		}
		string {
			'string'
		}
		f64 {
			'f64'
		}
		else {
			'else'
		}
	}
	_ = match x {
		int {
			'int'
		}
		string {
			'string'
		}
		else {
			'else'
		}
		f64 {
			'f64'
		}
	}
}