From a92a8003600dc2a0dc867c31bd817320cf6f7c56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 18 Jul 2022 23:07:41 +0800 Subject: fix #1346 --- test/diagnostics/type-check.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/diagnostics/type-check.lua') diff --git a/test/diagnostics/type-check.lua b/test/diagnostics/type-check.lua index b99e226c..c3bc3301 100644 --- a/test/diagnostics/type-check.lua +++ b/test/diagnostics/type-check.lua @@ -1,6 +1,7 @@ local config = require 'config' config.add(nil, 'Lua.diagnostics.disable', 'unused-local') +config.add(nil, 'Lua.diagnostics.disable', 'unused-function') config.add(nil, 'Lua.diagnostics.disable', 'undefined-global') TEST [[ @@ -727,6 +728,15 @@ TEST [[ ---@type number local x = G ]] + +TEST [[ +---@generic T +---@param x T +---@return T +local function f(x) + return x +end +]] config.set(nil, 'Lua.type.weakUnionCheck', false) TEST [[ @@ -765,4 +775,5 @@ f() ]] 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