Closed dubiousjim closed 3 months ago
There's a similar test in tests/conformance/basic.lua, starting around line 729.
Yeah this predates the table invariant. I think these will need to be adjusted to find with an offset as that's the only case when indexing with an increasing sequence can access hash part now.
These lines say:
The test passes, but does it really succeed in testing what it claims to? I added a C function to ltablib.cpp that will just return the
arraysize
of a table argument. When I then calltable.size({[(1)] = true})
, I get a return value of1
, indicating that the literal being created puts the entry in the array part, not in the hash part.Perhaps in some older version of Luau, the table literal was handled in the way this test references, but this behavior is now gone, and the test was never updated?