Skip to content

need-check-nil depends on the define order #904

@phanen

Description

@phanen
---@diagnostic disable: unused
local M = {}

---@generic T: table
---@param orig T
---@return T
local function deepcopy(orig)
	return orig
end

local f = function()
	---@type boolean, string[]
	local cond, lines
	if cond then
		lines = M.strip_cr(lines)
	end
	lines = deepcopy(lines)
	lines[#lines] = nil
end

---@param xs0 string[]
---@return string[]
function M.strip_cr(xs0)
	return xs0
end

return M

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