summaryrefslogtreecommitdiff
path: root/script/core
diff options
context:
space:
mode:
authorarthur <1348392749@qq.com>2021-11-01 11:52:55 +0800
committerarthur <1348392749@qq.com>2021-11-01 11:52:55 +0800
commit46211dc0b402086b6765c24e6174fdc2b007d326 (patch)
tree805746a0430807299e71b4916f620eb5a1f42203 /script/core
parentccd64c01245cdedd612f732ee541da088899ee1e (diff)
downloadlua-language-server-46211dc0b402086b6765c24e6174fdc2b007d326.zip
fix bug:addFather:k is not a string
Diffstat (limited to 'script/core')
-rw-r--r--script/core/diagnostics/type-check.lua18
1 files changed, 10 insertions, 8 deletions
diff --git a/script/core/diagnostics/type-check.lua b/script/core/diagnostics/type-check.lua
index c7e806ea..bf481588 100644
--- a/script/core/diagnostics/type-check.lua
+++ b/script/core/diagnostics/type-check.lua
@@ -118,14 +118,16 @@ end
local function addFatherClass(infers)
for k in pairs(infers) do
- local docDefs = vm.getDocDefines(k)
- for _, doc in ipairs(docDefs) do
- if doc.parent
- and doc.parent.type == 'doc.class'
- and doc.parent.extends then
- for _, tp in ipairs(doc.parent.extends) do
- if tp.type == 'doc.extends.name' then
- infers[tp[1]] = true
+ if type(k) == 'string' then
+ local docDefs = vm.getDocDefines(k)
+ for _, doc in ipairs(docDefs) do
+ if doc.parent
+ and doc.parent.type == 'doc.class'
+ and doc.parent.extends then
+ for _, tp in ipairs(doc.parent.extends) do
+ if tp.type == 'doc.extends.name' then
+ infers[tp[1]] = true
+ end
end
end
end