Skip to content

Wrong behavior in new diagnostic missing-fields with union types #2214

Closed
@TwIStOy

Description

@TwIStOy

How are you using the lua-language-server?

NeoVim

Which OS are you using?

MacOS

What is the issue affecting?

Annotations, Type Checking, Diagnostics/Syntax Checking

Expected Behaviour

The given code:

---@class Foo
---@field a number
---@field b number
---@field c number

---@type Foo|Foo[]
local a = {
  {
    a = 1,
    b = 2,
    c = 3,
  }
}

Should not report nothing. Because a matches Foo[].

Actual Behaviour

Report missing-field diagnostic.

Reproduction steps

Code above...

Additional Notes

No response

Log File

No response

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