summaryrefslogtreecommitdiff
path: root/test/type_inference/init.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-23 23:36:30 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-23 23:36:30 +0800
commit0652fa586d62408e28d8f7d253aa96381d357bc8 (patch)
treeaa2f37d508318e976f2ee17aef919883321cdf12 /test/type_inference/init.lua
parent3f815c836beb054a13f8d250f6f05a54778b72ba (diff)
downloadlua-language-server-0652fa586d62408e28d8f7d253aa96381d357bc8.zip
infer by `if not x then return end`
Diffstat (limited to 'test/type_inference/init.lua')
-rw-r--r--test/type_inference/init.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index 389fb5be..64cc43a8 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -1840,6 +1840,17 @@ local x
<?x?> = x or 1
]]
+TEST 'integer' [[
+---@type integer?
+local x
+
+if not x then
+ return
+end
+
+print(<?x?>)
+]]
+
TEST 'integer' [=[
local x