summaryrefslogtreecommitdiff
path: root/test/type_inference/init.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-24 22:39:58 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-24 22:39:58 +0800
commit943ba62782d8eed159c1b548c2718db228afc1a8 (patch)
tree12bde74001531c3258d01d1c8c26cc5480b5cfd8 /test/type_inference/init.lua
parent1d7773f05477ca3f637fa8afe05658868bf38a26 (diff)
downloadlua-language-server-943ba62782d8eed159c1b548c2718db228afc1a8.zip
fix `or`
Diffstat (limited to 'test/type_inference/init.lua')
-rw-r--r--test/type_inference/init.lua15
1 files changed, 13 insertions, 2 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index a6f18f65..21e140af 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -2060,11 +2060,22 @@ if x.y or not x then
end
]]
-TEST 'integer?' [[
+TEST 'integer' [[
---@type integer?
local x
-if not x or x.y then
+if not x or not y then
+ return
+end
+
+print(<?x?>)
+]]
+
+TEST 'integer' [[
+---@type integer?
+local x
+
+if not y or not x then
return
end