From 7ef36fadb3607f8472239bd435b666399b0327d1 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, 8 Mar 2023 22:07:21 +0800 Subject: fix #1928 --- test/diagnostics/type-check.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test/diagnostics') diff --git a/test/diagnostics/type-check.lua b/test/diagnostics/type-check.lua index 568e8985..4abe5855 100644 --- a/test/diagnostics/type-check.lua +++ b/test/diagnostics/type-check.lua @@ -1224,6 +1224,20 @@ Class.staticCreator() ClassstaticCreator() -- Expecting a waring ]] +TESTWITH 'assign-type-mismatch' [[ +---@type string[] +local arr = { + , +} +]] + +TESTWITH 'assign-type-mismatch' [[ +---@type (string|boolean)[] +local arr2 = { + , -- no warnings +} +]] + 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