diff options
Diffstat (limited to 'server-beta/src/core/diagnostics/unused-local.lua')
-rw-r--r-- | server-beta/src/core/diagnostics/unused-local.lua | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/server-beta/src/core/diagnostics/unused-local.lua b/server-beta/src/core/diagnostics/unused-local.lua index e6052e39..22b2e16b 100644 --- a/server-beta/src/core/diagnostics/unused-local.lua +++ b/server-beta/src/core/diagnostics/unused-local.lua @@ -9,7 +9,15 @@ local function hasGet(loc) end for _, ref in ipairs(loc.ref) do if ref.type == 'getlocal' then - return true + if not ref.next then + return true + end + local nextType = ref.next.type + if nextType ~= 'setmethod' + and nextType ~= 'setfield' + and nextType ~= 'setindex' then + return true + end end end return false |