Skip to content

param-type-not-match diagnostic used instead of missing-fields with parameter optional #579

@PeterCardenas

Description

@PeterCardenas

The following I expect to show the missing-fields diagnostic, but instead it shows the param-type-not-match diagnostic:

---@class testing
---@field wow string
---@field testing string

---@param c testing?
local function test(c) end

test({
  testing = '',
})

If the ? is removed from the end of the testing parameter, then both the missing-fields and param-type-not-match diagnostics disappear. Side note, I'd prefer only the missing-fields diagnostic to show up since that's how lua_ls behaves.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions