v2 / vlib / v / tests / vargs_empty_param_test.v
20 lines · 17 sloc · 276 bytes · b712af56fd8bcf74d3fa1b0e88c984d048e64a6a
Raw
1struct Config {
2 token string
3}
4
5struct Client {
6 x u64
7 y u64
8}
9
10fn new(config Config, shard_count ...int) ?&Client {
11 return &Client{1, 2}
12}
13
14fn test_can_compile_an_empty_var_arg() {
15 x := new(Config{
16 token: 'xyz'
17 }) or { panic(err) }
18 assert x.x == 1
19 assert x.y == 2
20}
21