summaryrefslogtreecommitdiff
path: root/test/diagnostics
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-08-22 17:08:39 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-08-22 17:08:39 +0800
commitcb16010fbb4128e2a5a31013e02b8cc4a4318be8 (patch)
tree0be2ac73f9bf987ea33fc070201d1eb238839dc3 /test/diagnostics
parenta5c3b64c217fb2691a23ca3b849567474b653ddf (diff)
downloadlua-language-server-cb16010fbb4128e2a5a31013e02b8cc4a4318be8.zip
fix wrong `missing-fields` with union types
fix #2252
Diffstat (limited to 'test/diagnostics')
-rw-r--r--test/diagnostics/missing-fields.lua26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/diagnostics/missing-fields.lua b/test/diagnostics/missing-fields.lua
index f5fdd35c..ab87f81d 100644
--- a/test/diagnostics/missing-fields.lua
+++ b/test/diagnostics/missing-fields.lua
@@ -205,3 +205,29 @@ TEST [[
---@type A
return <!{}!>
]]
+
+TEST [[
+---@class A
+---@field x number
+
+---@class B
+---@field y number
+
+---@type A|B
+local t = <!{
+ z = 1,
+}!>
+]]
+
+TEST [[
+---@class A
+---@field x number
+
+---@class B
+---@field y number
+
+---@type A|B
+local t = {
+ y = 1,
+}
+]]