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

unused_variable false positive when mutating over the return value of a function #30

Closed
Kampfkarren opened this issue Nov 6, 2019 · 0 comments
Labels
A-lints Area: Relating to a lint directly C-bug Category: Bug

Comments

@Kampfkarren
Copy link
Owner

Kampfkarren commented Nov 6, 2019

local runServicePrototype = getmetatable(habitat.game:GetService("RunService")).class.prototype
function runServicePrototype.IsServer()
	return true
end

throws:

warning[unused_variable]: runServicePrototype is assigned a value, but never used

    ┌── Tests/tests.lua:88:7 ───
    │
 88 │ local runServicePrototype = getmetatable(habitat.game:GetService("RunService")).class.prototype
    │       ^^^^^^^^^^^^^^^^^^^
    │

This does not happen when the code is:

runServicePrototype.IsServer = function()
	return true
end
@Kampfkarren Kampfkarren added C-bug Category: Bug A-lints Area: Relating to a lint directly labels Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lints Area: Relating to a lint directly C-bug Category: Bug
Projects
None yet
Development

No branches or pull requests

1 participant