Skip to content

enum & bit operation #1675

Description

@RomanSpector

How are you using the lua-language-server?

Visual Studio Code Extension (sumneko.lua)

Which OS are you using?

Windows

What is the issue affecting?

Other

Expected Behaviour

image

Actual Behaviour

image

Reproduction steps

---@enum Enum
local Enum = {
    ENUM_0 = 0,
    ENUM_1 = 1,
    ENUM_2 = 2,
}

---@class Class
local Class =
{
    enum = 2,
}

---@param enum Enum
---@return boolean
function Class:HasEnum(enum)
    return bit.band(self.enum, enum) ~= 0;
end

Additional Notes

No response

Log File

No response

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