Skip to content

cannot pairs on a table that uses enum values for keys #642

Closed

Description

@lewis6991
--- @enum Severity
local severity = {
  ERROR = 1,
  WARN = 2,
  INFO = 3,
  HINT = 4,
}

local severities = {
  [severity.ERROR] = 1,
  [severity.WARN] = 2,
  [severity.INFO] = 3,
  [severity.HINT] = 4,
}

for k in pairs(severities) do
  local _ = k -- k is unknown
end

Activity

  1. CppCXY commented on Jul 18, 2025

    @CppCXY
    Member

    This is because there are some issues with the order in which we compute members, and it can only be resolved in the next round of refactoring.

  2. added a commit that references this issue on Feb 6, 2026
    a42bf47
  3. added a commit that references this issue on Feb 26, 2026
    899bce7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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