summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--script/core/diagnostics/duplicate-index.lua2
-rw-r--r--test/diagnostics/init.lua7
2 files changed, 8 insertions, 1 deletions
diff --git a/script/core/diagnostics/duplicate-index.lua b/script/core/diagnostics/duplicate-index.lua
index 895aba7e..5d354329 100644
--- a/script/core/diagnostics/duplicate-index.lua
+++ b/script/core/diagnostics/duplicate-index.lua
@@ -17,7 +17,7 @@ return function (uri, callback)
if obj.type == 'tablefield'
or obj.type == 'tableindex' then
local name = noder.getID(obj)
- if name then
+ if name and name:sub(-1) ~= '*' then
if not mark[name] then
mark[name] = {}
end
diff --git a/test/diagnostics/init.lua b/test/diagnostics/init.lua
index 0f15c1d6..be83ac96 100644
--- a/test/diagnostics/init.lua
+++ b/test/diagnostics/init.lua
@@ -1146,3 +1146,10 @@ return {
['1'] = 1,
}
]]
+
+TEST [[
+return {
+ [print()] = 1,
+ [print()] = 1,
+}
+]]