summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-03-10 20:11:36 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-03-10 20:11:36 +0800
commit38a2b7f9df15b8737ba6fba27861eba50b2277b6 (patch)
tree5c48cf092b813837801b8ff09e52f99e392fbe84 /test
parentc5170054e2873592c3967d440cb4debb42a09324 (diff)
downloadlua-language-server-38a2b7f9df15b8737ba6fba27861eba50b2277b6.zip
update
Diffstat (limited to 'test')
-rw-r--r--test/type_inference/init.lua26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index 5ebe5778..37aa24b0 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -381,10 +381,36 @@ local <?x?>
]]
TEST '"enum1"|"enum2"' [[
+---@type 'enum1' | 'enum2'
+local <?x?>
+]]
+
+TEST '"enum1"|"enum2"' [[
---@type '"enum1"' | '"enum2"'
local <?x?>
]]
+TEST 'A' [[
+---@alias A 'enum1' | 'enum2'
+
+---@type A
+local <?x?>
+]]
+
+TEST 'A' [[
+---@alias A 'enum1' | 'enum2' | A
+
+---@type A
+local <?x?>
+]]
+
+TEST 'A' [[
+---@alias A 'enum1' | 'enum2' | B
+
+---@type A
+local <?x?>
+]]
+
TEST 'fun()' [[
---@type fun()
local <?x?>