summaryrefslogtreecommitdiff
path: root/test/type_inference
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-07-04 02:06:48 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-07-04 02:06:48 +0800
commita310a975e80978714685586c0ff4fcf5aeb6e746 (patch)
treee8110a30390a08ea3c85ef527930839208de582c /test/type_inference
parent2dfed8a4aabd66c98777d37245ef5482b5ffdd48 (diff)
downloadlua-language-server-a310a975e80978714685586c0ff4fcf5aeb6e746.zip
stash
Diffstat (limited to 'test/type_inference')
-rw-r--r--test/type_inference/init.lua24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index 37cf0324..cfb7d3a6 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -3281,3 +3281,27 @@ local b
local c = a and b
local <?d?> = a or b
]]
+
+TEST 'number' [[
+local x
+
+---@return number
+local function f()
+end
+
+x = f()
+
+print(<?x?>)
+]]
+
+TEST 'number' [[
+local x
+
+---@return number
+local function f()
+end
+
+_, x = pcall(f)
+
+print(<?x?>)
+]]