diff options
author | arthur <1348392749@qq.com> | 2021-11-01 11:52:55 +0800 |
---|---|---|
committer | arthur <1348392749@qq.com> | 2021-11-01 11:52:55 +0800 |
commit | 46211dc0b402086b6765c24e6174fdc2b007d326 (patch) | |
tree | 805746a0430807299e71b4916f620eb5a1f42203 /script/core | |
parent | ccd64c01245cdedd612f732ee541da088899ee1e (diff) | |
download | lua-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.lua | 18 |
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 |