summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-03-08 22:07:21 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-03-08 22:07:21 +0800
commit7ef36fadb3607f8472239bd435b666399b0327d1 (patch)
tree10c0558793449a89bd13678a3ef4471bfc2094ab /test
parent2704d390c550515d1b510a7277841288ee73f1bb (diff)
downloadlua-language-server-7ef36fadb3607f8472239bd435b666399b0327d1.zip
fix #1928
Diffstat (limited to 'test')
-rw-r--r--test/diagnostics/type-check.lua14
1 files changed, 14 insertions, 0 deletions
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(<!true!>)
Class<!:!>staticCreator() -- Expecting a waring
]]
+TESTWITH 'assign-type-mismatch' [[
+---@type string[]
+local arr = {
+ <!3!>,
+}
+]]
+
+TESTWITH 'assign-type-mismatch' [[
+---@type (string|boolean)[]
+local arr2 = {
+ <!3!>, -- 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')