summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-06-18 16:54:50 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-06-18 16:54:50 +0800
commitf86c80cf43729d09f816c2ae7c13a26d80ed1179 (patch)
treed5c396e14036cf6570198476ab9d08751ce3a673 /script
parent7b3bdcfb3f62695bb8ad237046285634a701a697 (diff)
downloadlua-language-server-f86c80cf43729d09f816c2ae7c13a26d80ed1179.zip
update
Diffstat (limited to 'script')
-rw-r--r--script/vm/type.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/script/vm/type.lua b/script/vm/type.lua
index d2c5d663..15c94dfc 100644
--- a/script/vm/type.lua
+++ b/script/vm/type.lua
@@ -1,5 +1,6 @@
---@class vm
local vm = require 'vm.vm'
+local guide = require 'parser.guide'
---@param object vm.object
---@return string?
@@ -50,11 +51,6 @@ function vm.isSubType(uri, child, parent, mark)
return false
end
end
- if child:isOptional() then
- if not vm.isSubType(uri, 'nil', parent, mark) then
- return false
- end
- end
return true
end
@@ -93,6 +89,10 @@ function vm.isSubType(uri, child, parent, mark)
return true
end
+ if parentName == 'table' and not guide.isBasicType(childName) then
+ return true
+ end
+
-- check class parent
if not mark[child] then
mark[child] = true