No type information for 'for _, desc in ipairs(model:GetDescendants()) do'

for_, descin ipairs(model:GetDescendants()) do
end

‘desc’ does not infer type information that is is an Instance. Manually fixed by doing:

for _, desc: Instance in ipairs(model:GetDescendants()) do
end

Expected behavior

‘desc’ should be inferred as Instance.

1 Like

Base type is Instance for the array.

Thank you for the report.

Should be an easy fix, we will change the return type to {Instance}.

4 Likes

lol this has been a problem for years

Check GetChildren as well and any like functions, thank you!!!

The fix for GetDescendants is now live.
Return type of GetChildren was correct when I last checked.

It still doesn’t work on game or workspace globals, but we have a separate fix in the works for those.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.