Open
Description
Disclaimer: I don't know if this is supported or expected to work.
Using v0.4-DEV on x86-64 Linux, if I try to access an array using an index from a list of list of indices (List[List[int]]
) while iterating, Cyber panics (third print
in the code). It seems like maybe the type information is wrong because if I wrap the value in int(...)
, then everything works fine (second print
in the code). Accessing outside of a "for each" loop seems to work fine as well (first print
in the code).
Minimal code sample:
var nestedIndices = List[List[int]]{ List[int]{1} }
var values = List[int]{3, 4, 5}
-- Works
print values[nestedIndices[0][0]]
for nestedIndices -> indices:
-- Works
print values[int(indices[0])]
-- panic: Out of bounds
print values[indices[0]]
I'm expecting the program to print the number 4 three times. Instead, I see:
4
4
panic: Out of bounds.
Metadata
Metadata
Assignees
Labels
No labels