Gitly
English
Русский
Español
日本語
中文
Português
Pricing
Log in
Register
vxx2
/
vlib
/
v
/
checker
/
tests
/
match_enum_ref.vv
18
lines
·
18
sloc
·
246 bytes
·
d912268e5dc45d38f4873ebcbed18e276746b23b
Raw
1
enum SomeType {
2
a
3
}
4
fn f(t &SomeType) ?int {
5
return match
6
t // note the missing asterisk
7
{
8
.a {
9
panic('This does not happen!')
10
3
11
}
12
}
13
}
14
fn main() {
15
t := SomeType.a
16
f(&t)?
17
assert false // should not happen, but does
18
}