Skip to content

Unable to use @enum or @alias type in table index (index signature) #2791

Description

@tmillr

I don't know if this is intended or not, but IIRC this is possible in typescript.

---@enum idx
local enum = { a = 'a', b = 'b' }

---@param tbl table<idx, string>
local function x(tbl) end

When calling x with a table (e.g. x({ | })), I expect to receive completion for a and b, but I don't get that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions