summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
Diffstat (limited to 'script')
-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