Failure case for detection of cycic tables

In the following minimal test case:

local subTable = {
    foo = {'bar'};
};
local mainTable = {foo = subTable, bar = subTable}

Studio thinks that “mainTable” is cyclic, even though it is not. Simply the following:

local subTable = {
    foo = {};
};
local mainTable = {foo = subTable, bar = subTable}

Will work correctly (being correctly displayed during debugging), which leads me to believe something buggy is going on and it’s not simply a complex case that the cycle detector has trouble with. This sort of failure makes debugging certain kinds of data structures really frustrating (I have to add a variable pointing to an extra deep-copied version of the table to enable viewing it’s contents).

6 Likes

Looks like arrays aren’t unmarked as visited.

Minimum test case here:

local t = {1}
Instance.new("BindableEvent"):Fire({t, t})

I’ll fix this today.

1 Like