From cb16010fbb4128e2a5a31013e02b8cc4a4318be8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 22 Aug 2023 17:08:39 +0800 Subject: fix wrong `missing-fields` with union types fix #2252 --- test/diagnostics/missing-fields.lua | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'test/diagnostics') 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 = +]] + +TEST [[ +---@class A +---@field x number + +---@class B +---@field y number + +---@type A|B +local t = { + y = 1, +} +]] -- cgit v1.2.3