Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server report Lua Diagnostics.: redundant-parameter uncorrectly #1103

Closed
kevinhwang91 opened this issue Apr 28, 2022 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@kevinhwang91
Copy link
Contributor

---@class Log
---@field trace fun(...)
---@field debug fun(...)
---@field info fun(...)
---@field warn fun(...)
---@field error fun(...)
local M = {}

local function assignLogLevel()
    local levelMap = {TRACE = 0, DEBUG = 1, INFO = 2, WARN = 3, ERROR = 4}
    for level in pairs(levelMap) do
        M[level:lower()] = function(...)
            local argc = select('#', ...)
            local _ = argc
            -- ......
        end
    end
end

assignLogLevel()

M.debug('1', '2') -- The function received a maximum of 1 arguments, but got 2.
                  -- Lua Diagnostics.: redundant-parameter
return M
@kevinhwang91
Copy link
Contributor Author

image

@sumneko sumneko added the bug Something isn't working label Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants