1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

cgen: fix multi_array index issue

This commit is contained in:
yuyi
2020-06-12 07:24:25 +08:00
committed by GitHub
parent c9cfe9d40b
commit ff1437fc5a
3 changed files with 38 additions and 7 deletions

View File

@ -816,3 +816,9 @@ fn test_array_with_cap() {
assert a5.len == 1
assert a5.cap == 10
}
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]]'
}