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

Wrong 'unused assignment' warnings #20

Open
rillig opened this issue Aug 30, 2020 · 1 comment
Open

Wrong 'unused assignment' warnings #20

rillig opened this issue Aug 30, 2020 · 1 comment

Comments

@rillig
Copy link

rillig commented Aug 30, 2020

#! /usr/bin/lua

local function format_mi()
	local head = {}
	local entries = {}

	local mi = assert(io.open("mi", "r"))
	for line in mi:lines() do
		if line:sub(1, 2) == "./" then
			table.insert(entries, line)
		else
			table.insert(head, line)
		end
	end
	io.write(string.format("%d head, %d entries\n", #head, #entries))
end

format_mi()

The following identifiers are wrongly marked as unused:

  • format_mi in line 3
  • head in line 4
  • entries in line 5
  • mi in line 7
  • line in line 8

The function assert in line 7 is highlighted and marked as "Unassigned variable usage", which is also wrong. I did set up Lua 5.3.5, which runs the program successfully.

image

@arafatx
Copy link

arafatx commented Nov 21, 2020

Same issue here: #16 and #15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants