summaryrefslogtreecommitdiff
path: root/script/vm
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-05-23 17:22:58 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-05-23 17:22:58 +0800
commit83f2b383bb2d1bc2defca63b6dd34d7f5875eef0 (patch)
tree9831f47e65daa7d42700906d9275e3563bdc4635 /script/vm
parent25a78532b67032176b6c255019c203927cd004b4 (diff)
downloadlua-language-server-83f2b383bb2d1bc2defca63b6dd34d7f5875eef0.zip
fix can not union `unknown` with other types
Diffstat (limited to 'script/vm')
-rw-r--r--script/vm/infer.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/script/vm/infer.lua b/script/vm/infer.lua
index fabc9828..dba46ffc 100644
--- a/script/vm/infer.lua
+++ b/script/vm/infer.lua
@@ -76,7 +76,9 @@ local viewNodeSwitch = util.switch()
: case 'global'
: call(function (source, infer)
if source.cate == 'type' then
- infer._hasClass = true
+ if source.name ~= 'unknown' then
+ infer._hasClass = true
+ end
if source.name == 'number' then
infer._hasNumber = true
end