summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-12-16 03:35:08 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-12-16 03:35:08 +0800
commit664a5c78ade155d99543c94d3f63b98b4d0df82d (patch)
tree5bb859bff2be4c42ab6be4dbe685e347781c7e09 /test
parent420197c19e223cf1c3ce33534abb38bba304896b (diff)
downloadlua-language-server-664a5c78ade155d99543c94d3f63b98b4d0df82d.zip
fix cast
Diffstat (limited to 'test')
-rw-r--r--test/type_inference/init.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index 0eb43ed3..b8ca4df9 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -4060,3 +4060,17 @@ local m, v
local <?r?> = m * v
]]
+
+TEST 'A|B' [[
+---@class A
+---@class B
+
+---@type A|B
+local t
+
+if x then
+ ---@cast t A
+else
+ print(<?t?>)
+end
+]]