From 91ae26be49374dee87d09f0fe9160cb393e4fef7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 22 Mar 2023 17:57:59 +0800 Subject: recover mark before return fix #2004 --- test/diagnostics/type-check.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test/diagnostics') diff --git a/test/diagnostics/type-check.lua b/test/diagnostics/type-check.lua index 4abe5855..18e7190d 100644 --- a/test/diagnostics/type-check.lua +++ b/test/diagnostics/type-check.lua @@ -1238,6 +1238,23 @@ local arr2 = { } ]] +TEST [[ +---@class A + +---@class B : A + +---@class C : B + +---@class D : B + +---@param x A +local function func(x) end + +---@type C|D +local var +func(var) +]] + config.remove(nil, 'Lua.diagnostics.disable', 'unused-local') config.remove(nil, 'Lua.diagnostics.disable', 'unused-function') config.remove(nil, 'Lua.diagnostics.disable', 'undefined-global') -- cgit v1.2.3