array of pointers support

This commit is contained in:
BigBlack 2019-12-18 08:26:04 +08:00 committed by Alexander Medvednikov
parent f00f9fbf5a
commit 67cf7f18e6
5 changed files with 27 additions and 15 deletions

View file

@ -3,6 +3,19 @@ const (
A = 8
)
fn test_pointer() {
mut arr := []*int
a := 1
b := 2
c := 3
arr << &a
arr << &b
arr << &c
assert *arr[0] == 1
arr[1] = &c
assert *arr[1] == 3
}
fn test_ints() {
mut a := [1, 5, 2, 3]
assert a.len == 4