summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--script/core/diagnostics/undefined-field.lua2
-rw-r--r--test/diagnostics/init.lua9
2 files changed, 10 insertions, 1 deletions
diff --git a/script/core/diagnostics/undefined-field.lua b/script/core/diagnostics/undefined-field.lua
index c5c64b4d..bfb12e34 100644
--- a/script/core/diagnostics/undefined-field.lua
+++ b/script/core/diagnostics/undefined-field.lua
@@ -29,7 +29,7 @@ return function (uri, callback)
local allDocClass = {}
for i = 1, #infers do
local infer = infers[i]
- if infer.type ~= '_G' and infer.type ~= 'any' then
+ if infer.type ~= '_G' and infer.type ~= 'any' and infer.type ~= 'table' then
local inferSource = infer.source
if inferSource.type == 'doc.class' then
addTo(allDocClass, inferSource)
diff --git a/test/diagnostics/init.lua b/test/diagnostics/init.lua
index f5ea6964..4e485d2a 100644
--- a/test/diagnostics/init.lua
+++ b/test/diagnostics/init.lua
@@ -951,3 +951,12 @@ v2 = v
v2:method1()
v2:method2() -- 这个感觉实际应该报错更合适
]]
+
+TEST [[
+---@type table
+T1 = {}
+print(T1.f1)
+---@type table*
+T2 = {}
+print(T2.<!f2!>)
+]]