Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v2
/
vlib
/
v
/
tests
/
comptime
/
comptime_match_ret_test.v
12
lines
·
11
sloc
·
195 bytes
·
23477fc77fc43af4f110eb030dc5338d1fc99949
Raw
1
fn
test[T]() bool {
2
return
$
match
T {
3
i8 {
true
}
4
i16 {
true
}
5
$
else
{ $compile_error(
'unsupported type'
) }
6
}
7
}
8
9
fn
test_main() {
10
assert test[i8]() ==
true
11
assert test[i16]() ==
true
12
}
13