1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/v/tests/match_expr_returning_sumtype_test.v

14 lines
200 B
V

type Ty = bool | int
fn test(a bool) Ty {
return match a {
true { 123 }
else { false }
}
}
fn test_match_expr_sumtype_eval() {
assert test(true) == Ty(123)
assert test(false) == Ty(false)
}