summaryrefslogtreecommitdiff
path: root/test/type_inference
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-24 03:23:29 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-24 03:23:29 +0800
commit082327ae5f54d14685a5ce580cd216bc16ef409e (patch)
treec1755d745e732f1425bf001894a14bf1f5fc2eba /test/type_inference
parent8e1ec50cfb47b60cc9b4ab2821b93edacff2c8e1 (diff)
downloadlua-language-server-082327ae5f54d14685a5ce580cd216bc16ef409e.zip
`x = x or y` -> truthy
Diffstat (limited to 'test/type_inference')
-rw-r--r--test/type_inference/init.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index edb8ff6b..052348e2 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -1841,6 +1841,13 @@ TEST 'integer' [[
---@type integer?
local x
+<?x?> = x or y
+]]
+
+TEST 'integer' [[
+---@type integer?
+local x
+
if not x then
return
end
@@ -1947,6 +1954,6 @@ TEST 'integer' [[
---@type integer?
local x
-if x and <?x?>.y then
+if x and <?x?> then
end
]]