v2 / vlib / v / tests / structs / default_expr_array_init_test.v
15 lines · 13 sloc · 224 bytes · a3665820109cbaa92111a6c35704397e4bce3004
Raw
1struct Foo {
2pub mut:
3 integer_range_for_discrete []int = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
4}
5
6fn foo(a string) Foo {
7 return match a {
8 'a' { Foo{} }
9 else { panic('foo') }
10 }
11}
12
13fn test_main() {
14 assert foo('a') == Foo{}
15}
16