summaryrefslogtreecommitdiff
path: root/test/type_inference
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-12-15 21:09:14 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-12-15 21:09:14 +0800
commit6e2d3d42dba22ee9f179546b1e92d0b3313ec1f5 (patch)
tree3d32e12c94ca119167e84eb994d859d91c690785 /test/type_inference
parenta744e3439e165be13f8f0ba5262b8f1efec0d86d (diff)
downloadlua-language-server-6e2d3d42dba22ee9f179546b1e92d0b3313ec1f5.zip
stash
Diffstat (limited to 'test/type_inference')
-rw-r--r--test/type_inference/init.lua28
1 files changed, 24 insertions, 4 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index 8ae65e48..0eb43ed3 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -1637,7 +1637,7 @@ function A()
end
]]
-TEST 'unknown' [[
+TEST 'string' [[
local x
function A()
@@ -2317,7 +2317,7 @@ local x
print(<?x?>)
]]
-TEST 'unknown?' [[
+TEST 'nil' [[
---@type string?
local x
@@ -2391,7 +2391,7 @@ end
print(<?t?>)
]]
-TEST 'unknown?' [[
+TEST 'nil' [[
---@type integer?
local t
@@ -3200,7 +3200,7 @@ local function f() end
local x, y, <?z?> = 1, 2, f()
]]
-TEST 'function' [[
+TEST 'unknown' [[
local f
print(<?f?>)
@@ -3208,6 +3208,26 @@ print(<?f?>)
function f() end
]]
+TEST 'unknown' [[
+local f
+
+do
+ print(<?f?>)
+end
+
+function f() end
+]]
+
+TEST 'function' [[
+local f
+
+function A()
+ print(<?f?>)
+end
+
+function f() end
+]]
+
TEST 'number' [[
---@type number|nil
local n