summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--script/core/diagnostics.lua8
-rw-r--r--test/diagnostics/normal.lua6
2 files changed, 13 insertions, 1 deletions
diff --git a/script/core/diagnostics.lua b/script/core/diagnostics.lua
index 3b11b818..499c5ffd 100644
--- a/script/core/diagnostics.lua
+++ b/script/core/diagnostics.lua
@@ -671,7 +671,13 @@ end
function mt:checkEmmyType(source, callback)
for _, tpsource in ipairs(source) do
- local name = tpsource[1]
+ -- TODO 临时决绝办法,重构后解决
+ local name
+ if tpsource.type == 'emmyArrayType' then
+ name = tpsource[1][1]
+ else
+ name = tpsource[1]
+ end
local class = self.vm.emmyMgr:eachClass(name, function (class)
if class.type == 'emmy.class' or class.type == 'emmy.alias' then
return class
diff --git a/test/diagnostics/normal.lua b/test/diagnostics/normal.lua
index 5fdc3ba8..4ead6df5 100644
--- a/test/diagnostics/normal.lua
+++ b/test/diagnostics/normal.lua
@@ -501,3 +501,9 @@ local t = {}
t.a = 1
t.a = 2
]]
+
+TEST [[
+---@type table<number, boolean|string[]>
+local t
+print(t)
+]]