Trying to get a type from a variadic type parameter

I’m creating an iterator function and am getting the warning Trying to get a type from a variadic type parameter when trying to contain the extra arguments. Does anyone know a fix? Calling it without holding the arguments in a table will give me an error btw.

function map<T, U, V...>(callback : (T, V...) -> (U), tbl : Array<T>, ... : V...) : () -> U?
    local i = 0
    local args : any = {...}
    return function()
        i += 1
        if tbl[i] == nil then return nil end
        return callback(tbl[i], unpack(args))
    end
end

How about table.pack(...) instead of {...}?

1 Like

just tried it and the warning is gone, thanks for the help