vxx2 / vlib / v / checker / tests / fn_call_arg_array_mismatch_err.vv
25 lines · 20 sloc · 419 bytes · 715a0a656ebef4a8a6dd285a55149402d2a6c2be
Raw
1import os
2
3const service_file = '[Unit]'
4const service_path = 'dockerman.service'
5
6fn main() {
7 os.write_file_array(service_path, service_file) or {
8 eprintln('Error: write file service')
9 exit(1)
10 }
11}
12
13// for issue 20172
14// dimension checking error when mut array is passed multiple times as args
15fn foo(mut arr []int) {
16 bar(mut arr)
17}
18
19fn bar(mut arr [][]int) {
20}
21
22fn baz() {
23 mut arr := [1, 2, 3]
24 foo(mut arr)
25}
26