Skip to content

Problem with table keys with union types #1273

Description

@NeOzay

Describe the bug

---@type table<string|number, string>
local t

---@type number
local n
---@type string
local s

local test  = t[n] 
local test2 = t[s] --test and test2 are unknow

t[1] and t[" "] work

Environment:

  • OS: Windows
  • Client: VSCode
  • Version: last release

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    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