summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-01-25 14:57:05 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-01-25 14:57:05 +0800
commite9192c353b4901a49bd20280c15a7c881ff7c6be (patch)
tree3d88dd66756e00db3cd7916f596e488b3f35ed14 /server
parent03cf351259bb4df569d7566ea6f108e200433c39 (diff)
downloadlua-language-server-e9192c353b4901a49bd20280c15a7c881ff7c6be.zip
类型推导
Diffstat (limited to 'server')
-rw-r--r--server/src/core/vm.lua2
-rw-r--r--server/test/type_inference/init.lua2
2 files changed, 2 insertions, 2 deletions
diff --git a/server/src/core/vm.lua b/server/src/core/vm.lua
index 68ef0efb..52c67606 100644
--- a/server/src/core/vm.lua
+++ b/server/src/core/vm.lua
@@ -332,7 +332,7 @@ function mt:setValue(var, value, source)
if value and value.type == 'list' then
error('Cant set value list')
end
- value = value or self:createValue('nil', source)
+ value = value or self:createValue('any', source)
if source and source.start then
self:addInfo(var, 'set', source, value)
value:addInfo('set', source, var)
diff --git a/server/test/type_inference/init.lua b/server/test/type_inference/init.lua
index 0962c20d..9cf93229 100644
--- a/server/test/type_inference/init.lua
+++ b/server/test/type_inference/init.lua
@@ -178,6 +178,6 @@ for <?i?> in ipairs(t) do
end
]]
-TEST 'any' [[
+TEST 'nil' [[
local <?x?> = next()
]]