diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-07-04 02:06:48 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-07-04 02:06:48 +0800 |
commit | a310a975e80978714685586c0ff4fcf5aeb6e746 (patch) | |
tree | e8110a30390a08ea3c85ef527930839208de582c /test | |
parent | 2dfed8a4aabd66c98777d37245ef5482b5ffdd48 (diff) | |
download | lua-language-server-a310a975e80978714685586c0ff4fcf5aeb6e746.zip |
stash
Diffstat (limited to 'test')
-rw-r--r-- | test/type_inference/init.lua | 24 |
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?>) +]] |