Skip to content

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

@kevinhwang91

Description

@kevinhwang91
---@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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions