Skip to content

enum bug #1370

Closed
Closed
@RomanSpector

Description

@RomanSpector

Works here:

image

And it doesn't work here anymore:
image

---@enum animal
Animal = {
  Cat = 1,
  Dog = 2,
}

---@param x animal
local function f(x) end

f(Animal.Cat) -- suggests `Animal.Cat`, `Animal.Dog`, `1`, `2` as the first parameter

---@enum flags
Flags =
{
    FLAG_1 = 0x00000000,
    FLAG_2 = 0x00000001,
    FLAG_3 = 0x00000002,
    FLAG_4 = 0x00000004,
    FLAG_5 = 0x00000008,
}

---@param flag flags
local function SetCharmInfoFlags(flag) end

SetCharmInfoFlags(Flags.FLAG_3);

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions