summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/diagnostics/assign-type-mismatch.lua7
-rw-r--r--test/hover/init.lua11
2 files changed, 18 insertions, 0 deletions
diff --git a/test/diagnostics/assign-type-mismatch.lua b/test/diagnostics/assign-type-mismatch.lua
index d4632563..dc55a7da 100644
--- a/test/diagnostics/assign-type-mismatch.lua
+++ b/test/diagnostics/assign-type-mismatch.lua
@@ -99,6 +99,13 @@ t['x'] = nil
]]
TEST [[
+---@type [boolean]
+local t = { <![1]!> = nil }
+
+t = nil
+]]
+
+TEST [[
local t = { true }
t[1] = nil
diff --git a/test/hover/init.lua b/test/hover/init.lua
index 63220a59..0cfce3a4 100644
--- a/test/hover/init.lua
+++ b/test/hover/init.lua
@@ -1228,6 +1228,17 @@ local <?x?>
local x: table<ClassA, ClassB>
]]
+TEST [[
+---@type [ClassA, ClassB]
+local <?x?>
+]]
+[[
+local x: [ClassA, ClassB] {
+ [1]: ClassA,
+ [2]: ClassB,
+}
+]]
+
--TEST [[
-----@class ClassA
-----@class ClassB