summaryrefslogtreecommitdiff
path: root/test/type_inference/init.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-06-18 01:45:57 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-06-18 01:45:57 +0800
commitbc4e205a4953a7f3a99bafc9fc88295f929beab1 (patch)
treeef92cc3c1438dd292a6df754af53df5d805f1a53 /test/type_inference/init.lua
parent5099d8be7125b948691d099b0e0084a72620293b (diff)
downloadlua-language-server-bc4e205a4953a7f3a99bafc9fc88295f929beab1.zip
update
Diffstat (limited to 'test/type_inference/init.lua')
-rw-r--r--test/type_inference/init.lua14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index aa424d9c..d706798b 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -2347,7 +2347,7 @@ end
print(t)
]]
-TEST 'table|unknown' [[
+TEST 'table' [[
local function f()
if x then
return y
@@ -2687,3 +2687,15 @@ t.x = f()
print(t.<?x?>)
]]
+
+TEST 'integer' [[
+local function f()
+ if X then
+ return X
+ else
+ return 1
+ end
+end
+
+local <?n?> = f()
+]]