Skip to content

Incorrectly reports unreachable-code #1363

Description

@Nexela
--- @diagnostic disable
--- @diagnostic enable: unreachable-code
---@param s string
---@return any[]
---@nodiscard
function test(s, sep, pattern, func)
  while start_idx do
    start_idx, end_idx = s:find(sep, end_idx + 1)
  end
  local sub_str = s:sub(last_find)
  if sub_str:len() > 0 then table.insert(fields, func(s:sub(last_find))) end
  return fields
end

image

image

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