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

allow slicing of fixed size arrays

This commit is contained in:
Alexander Medvednikov
2020-03-31 16:47:55 +02:00
parent d048bf66b0
commit 9d630dff30
5 changed files with 42 additions and 8 deletions

View File

@@ -246,6 +246,7 @@ fn test_slice() {
assert a.len == 4
}
fn test_push_many() {
mut a := [1, 2, 3]
b := [4, 5, 6]
@@ -283,6 +284,8 @@ struct Foooj {
fn test_fixed() {
mut nums := [4]int
x := nums[1..3]
assert x.len == 2
assert nums[0] == 0
assert nums[1] == 0
assert nums[2] == 0