luau
luau copied to clipboard
"Cannot iterate over a table without indexer" when using generalised iteration
local v = {
["x"] = 1,
["y"] = 2,
["z"] = 3
}
-- Or, alternatively
-- local v = {
-- x = 1,
-- y = 2,
-- z = 3
-- }
for a, b in v do
-- ^ TypeError: Cannot iterate over a table without indexer
end
This is a really annoying bug. I keep encountering it in my projects.
Why does this happen? Is there a path towards resolving it anytime soon?