-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
Description
In new version of Nim I've got different results when trying to receive values from table:
import tables
const tableOfArray = {
"one": [true, false, false],
"two": [false, true, false],
"three": [false, false, true]
}.toTable()
for i in 0..2:
echo tableOfArray["two"][i]Code above must print false true false to console, but instead it can return all values as false. Or fall into infinity loop. Or throw exception. Anything but proper result.
Same if I change const to let. But it works when I use var:
var tableOfArray = {
"one": [true, false, false],
"two": [false, true, false],
"three": [false, false, true]
}.toTable()When I use sequence instead of array it works too:
const tableOfArray = {
"one": @[true, false, false],
"two": @[false, true, false],
"three": @[false, false, true]
}.toTable()