Skip to content

for遍历tuple里错误的nil推断 #891

@tinyleolin

Description

@tinyleolin
---@param a number
local function fff(a) end
-- 这里如果加上注解就好了 ---@type number[]
local t = { 1, 2, 3 }
for i = 1, #t do
	fff(t[i])
end

t[i]位置会提示

expected number but found (1|2|3)?.

Metadata

Metadata

Assignees

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