summaryrefslogtreecommitdiff
path: root/test/diagnostics/param-type-mismatch.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/diagnostics/param-type-mismatch.lua')
-rw-r--r--test/diagnostics/param-type-mismatch.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/diagnostics/param-type-mismatch.lua b/test/diagnostics/param-type-mismatch.lua
index 2a4bfcb1..e31e9933 100644
--- a/test/diagnostics/param-type-mismatch.lua
+++ b/test/diagnostics/param-type-mismatch.lua
@@ -91,6 +91,22 @@ f(<!{ h = 1 }!>)
]]
TEST [[
+---@enum(key) A
+local t = {
+ x = 1,
+ ['y'] = 2,
+}
+
+---@param x A
+local function f(x)
+end
+
+f('x')
+f('y')
+f(<!'z'!>)
+]]
+
+TEST [[
---@generic T: string | boolean | table
---@param x T
---@return T