v2 / vlib / v / tests / structs / short_struct_param_syntax_test.v
18 lines · 16 sloc · 207 bytes · 6488041a749df9762348d019c4223908c476f2e2
Raw
1struct TOptions {
2 a int
3}
4
5fn t(options TOptions) bool {
6 if options.a == 1 {
7 return true
8 }
9 return false
10}
11
12fn test_short_struct_as_parameter() {
13 if t(a: 1) {
14 assert true
15 return
16 }
17 assert false
18}
19