The script linter is always reporting that I am using the wrong number of arguments when connecting to AncestryChanged, including when I am passing the correct amount (two):
- With zero arguments passed (works as intended):
- With one argument passed (works as intended):
-
With two arguments passed (broken):
- With three or more arguments passed (works as intended):
Reproduction steps:
- Create a script in an empty baseplate with “Enable New Lua Script Analysis” turned on in the beta features menu, and paste the following source code:
--!strict
local part = Instance.new("Part")
part.AncestryChanged:Connect(function(a, b)
-- !!!!!
end)
- The last three lines should be highlighted with a yellow underline and a warning will be displayed in the Script Analysis widget.
The bug happens in the Studio code editor on the latest version (0.439).
EDIT: Adding return nil
to the end of the connected function silenced the warn.