I’m working on a maid object and I’ve run into an issue where it’s telling me that it expected type table when trying to index an instance with a string, which should return either a property, function, or rbxscriptsignal, and it does, it works as normal. Is there any way to silence this warning?
I underlined where the warning appears in red, I can’t show it but the title is the error, “Expected type table, got ‘Instance’ instead”
function module.CreateTask(self: maid, instance: Instance, connectionName: string, connectionFunction: (any) -> any, taskName: any?)
local tasks = self.tasks
tasks[instance] = tasks[instance] or {}
local tasksForThisInstance = tasks[instance]
taskName = taskName or #tasksForThisInstance + 1
if taskName then
if tasksForThisInstance[taskName] then
utility.warn('[Maid.CreateTask]: A connection with the name ',taskName,'already exists!')
end
end
instance[connectionName]:Connect(connectionFunction)
return taskName :: typeof(taskName) | number
end
self: maid: a maid object returned from module.new() instance: Instance: the instance to create a connection for connectionName: string: the name of the RBXScriptSignal connectionFunction: function, the function to pass to the connect statement
It isn’t erroring, it’s just the warning that I wanna get rid of.