v2 / vlib / v / tests / aliases / alias_array_no_cast_init_test.v
12 lines · 10 sloc · 278 bytes · 6488041a749df9762348d019c4223908c476f2e2
Raw
1pub type Labels = [][]int
2
3pub fn new_labels(width int, height int) Labels {
4 mut labels := Labels{len: height, init: []int{len: width}}
5 return labels
6}
7
8fn test_alias_array_no_cast_init() {
9 mut labels := new_labels(2, 2)
10 println(labels)
11 assert labels == [[0, 0], [0, 0]]
12}
13