diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-12-16 15:39:25 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-12-16 15:39:25 +0800 |
commit | 72a4342c054851b19b6b82105d34c2184414cd60 (patch) | |
tree | 9166fa71e2ad9175d4533d1f4eab4fb0c763c2a9 /test/type_inference | |
parent | bc436972d2793e38f71cde5c1b01e9bb317e1c17 (diff) | |
download | lua-language-server-72a4342c054851b19b6b82105d34c2184414cd60.zip |
fix
Diffstat (limited to 'test/type_inference')
-rw-r--r-- | test/type_inference/init.lua | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index 96393578..4479e031 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -4088,6 +4088,36 @@ elseif <?t?> then end ]] +TEST 'A|B' [[ +---@class A +---@class B + +---@type A|B +local t + +if x then + ---@cast t A + print(t) +elseif <?t?> then +end +]] + +TEST 'A|B' [[ +---@class A +---@class B + +---@type A|B +local t + +if x then + ---@cast t A + print(t) +elseif <?t?> then + ---@cast t A + print(t) +end +]] + TEST 'function' [[ local function x() print(<?x?>) |