summaryrefslogtreecommitdiff
path: root/script/vm/type.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-07-12 16:28:49 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-07-12 16:28:49 +0800
commit84cd1c05f26842c2ae72238ec5d68bba8464ef4d (patch)
treed1b49e150d6bbade44c48809bbad26d22b40415b /script/vm/type.lua
parentc7c1249dc0b30fa47dc8b8f12a9bb8a8995cfa6c (diff)
downloadlua-language-server-84cd1c05f26842c2ae72238ec5d68bba8464ef4d.zip
fix
Diffstat (limited to 'script/vm/type.lua')
-rw-r--r--script/vm/type.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/script/vm/type.lua b/script/vm/type.lua
index ed7eba16..0432876c 100644
--- a/script/vm/type.lua
+++ b/script/vm/type.lua
@@ -153,14 +153,16 @@ function vm.isSubType(uri, child, parent, mark)
end
-- check class parent
- if childName and not mark[childName] and not guide.isBasicType(childName) then
+ if childName and not mark[childName] then
mark[childName] = true
+ local isBasicType = guide.isBasicType(childName)
local childClass = vm.getGlobal('type', childName)
if childClass then
for _, set in ipairs(childClass:getSets(uri)) do
if set.type == 'doc.class' and set.extends then
for _, ext in ipairs(set.extends) do
if ext.type == 'doc.extends.name'
+ and (not isBasicType or guide.isBasicType(ext[1]))
and vm.isSubType(uri, ext[1], parent, mark) then
return true
end