Skip to content

2-level deep ipairs type deduction failure #625

Description

@MikuAuahDark

Describe the bug
When a variable has type of sometype[][] where sometype can be any type except any, the 2nd-level ipairs fails to use correct type for the value variable.

To Reproduce

---@type string[][]
local v = {}

for _, a in ipairs(v) do
	for i, b in ipairs(a) do
		local n = b -- "n" is NOT string!
	end
end

Expected behavior
In above code, n (and b) type should be string.

Screenshots
gambar

Environment (please complete the following information):

  • OS: Windows
  • Is WSL remote? No
  • Client: VSCode

Additional context
The variable a above correctly set as string[].

Provide logs
file_d%3A_Data_Development_love-11.3-win64_nlay.log

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