local function foo(bar, ...)
-- Either
local args = {...}
local baz = args[1]
-- or directly
local baz = select(1, ...) -- Selects the first arg - remember lua indexes from 1 not 0
end
TLDR: ... will expand completely only if put as the last argument of a function.
This problem here is that doing map(..., {}) will actually only put the first argument of ... as the argument of map (as indicated by the error, saying that {}is actually passed as the second argument here).
My advice would be to just list the arguments exhaustively and pass them down manually. I don’t think that this case is a good use of ....