Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2-level deep ipairs type deduction failure #625

Closed
MikuAuahDark opened this issue Jul 29, 2021 · 0 comments
Closed

2-level deep ipairs type deduction failure #625

MikuAuahDark opened this issue Jul 29, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@MikuAuahDark
Copy link

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

@sumneko sumneko added the bug Something isn't working label Jul 29, 2021
@sumneko sumneko closed this as completed in ee1fd6e Aug 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants