duplicate-set-field diagnostic when assigning a function to a table field
How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
Which OS are you using?
Windows
What is the issue affecting?
Diagnostics/Syntax Checking
Expected Behaviour
No diagnostic warning on assignment because the variable has been 'cleared'.
Actual Behaviour
The two info.func assignments that are "= function" get a Duplicate field 'func' (duplicate-set-field) diagnostic. The info.func assignment "= l1" does not. Scope depth does not seem to impact the diagnostic - within the same function.
Assignments to other fields that are string, integer, etc do not get the diagnostic. FYI - the ".func" is expected in a library I cannot change.
Reproduction steps
local function l1() end local function f1() local info = {}; do info = {}; info.notCheckable = true info.func = function() -- any code end end info = {}; info.notCheckable = true info.func = function() -- any code end info = {}; info.notCheckable = true info.func = l1 end
Additional Notes
No response
Log File
No response
chiming in that I also experience this