mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
array: fix multiple array.repeat index error
This commit is contained in:
@@ -821,4 +821,8 @@ fn test_mutli_array_index() {
|
||||
mut a := [][]int{len:2, init: []int{len:3, init:0}}
|
||||
a[0][0] = 1
|
||||
assert '$a' == '[[1, 0, 0], [0, 0, 0]]'
|
||||
|
||||
mut b := [[0].repeat(3)].repeat(2)
|
||||
b[0][0] = 1
|
||||
assert '$b' == '[[1, 0, 0], [0, 0, 0]]'
|
||||
}
|
||||
|
Reference in New Issue
Block a user