summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-06-14 18:25:41 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-06-14 18:25:41 +0800
commiteb7363f1c70e62d0f27c675f49b0d28113d4afa4 (patch)
tree6de7a143ddaa18685a567ec7046db2afa18cf817 /test
parent2b0fcec7b17c2c01942a277e938f918dc52ff62c (diff)
downloadlua-language-server-eb7363f1c70e62d0f27c675f49b0d28113d4afa4.zip
update
Diffstat (limited to 'test')
-rw-r--r--test/type_inference/init.lua25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index 7d0fec91..2dd6971b 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -2257,6 +2257,19 @@ local x
print(<?x?>)
]]
+TEST 'unknown?' [[
+---@type string?
+local x
+
+if x then
+ return
+else
+ print(<?x?>)
+end
+
+print(x)
+]]
+
TEST 'string' [[
---@type string?
local x
@@ -2318,6 +2331,18 @@ end
print(<?t?>)
]]
+TEST 'unknown?' [[
+---@type integer?
+local t
+
+if t then
+else
+ print(<?t?>)
+end
+
+print(t)
+]]
+
TEST 'table|unknown' [[
local function f()
if x then