Mixed tables should throw errors with Remote/Bindable Event/Functions

The following code shows the key B gets culled without an error

local bindable = Instance.new("BindableEvent")

local function printTable(tab, depth)
	depth = depth or 0
	local indent = string.rep("\t", depth)
	for i, v in pairs(tab) do
		if type(v) == "table" then
			print(indent .. i .. " : {")
			printTable(v, depth + 1)
			print(indent .. "}")
		else
			print(indent .. i .. ": " .. tostring(v))
		end	
	end
	
end

bindable.Event:Connect(printTable)
bindable:Fire({ 1, 2, 3, B = 1 })

Output:

1: 1
2: 2
3: 3
2 Likes

Is that supposed to error? I thought it “worked”, but the behaviour was undefined.

This is a feature request not a bug, the behavior is defined on the Wiki.

If a Table is passed as an argument to a BindableEvent it must be an array without missing entries or have string keys, not a mixture, or else the string keys will be lost.

Sorry, but I don’t agree. Just because this bug is documented on the wiki doesn’t mean it’s not a bug.

Other tables error when they are mixed, I don’t see how this one not erroring isn’t a bug?

Hi Partixel,

@woot3 is correct – this belongs in a feature request.

If it were intended to work, it would be a bug, but in this case this was intentional.

1 Like

Alright if you guys insist.