summaryrefslogtreecommitdiff
path: root/test/diagnostics
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-07-25 11:44:31 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-07-25 11:44:31 +0800
commitf1c9b931d6eb1918b29497dcbf162f228e207126 (patch)
treef95678a9bc1406176555ad2191f13bd322766365 /test/diagnostics
parentecda29f02cc99304b254a7677c65aca8e8f457f3 (diff)
downloadlua-language-server-f1c9b931d6eb1918b29497dcbf162f228e207126.zip
fix #2214
Diffstat (limited to 'test/diagnostics')
-rw-r--r--test/diagnostics/common.lua39
1 files changed, 39 insertions, 0 deletions
diff --git a/test/diagnostics/common.lua b/test/diagnostics/common.lua
index aff97c77..28a3a32a 100644
--- a/test/diagnostics/common.lua
+++ b/test/diagnostics/common.lua
@@ -2431,3 +2431,42 @@ TEST [[
---@class A
local t = {}
]]
+
+TEST [[
+---@diagnostic disable: unused-local
+
+---@class Foo
+---@field a number
+---@field b number
+---@field c number
+
+---@type Foo|Foo[]
+local a = {
+ {
+ a = 1,
+ b = 2,
+ c = 3,
+ }
+}
+]]
+
+TEST [[
+---@diagnostic disable: unused-local
+
+---@class Foo
+---@field a number
+---@field b number
+---@field c number
+
+---@class Bar
+---@field ba number
+---@field bb number
+---@field bc number
+
+---@type Foo|Bar
+local b = {
+ a = 1,
+ b = 2,
+ c = 3,
+}
+]]