From be5b77b7956970647d4d12d0e83ccf9bb410565b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= <sumneko@hotmail.com> Date: Wed, 16 Aug 2023 17:04:25 +0800 Subject: supports `---@enum (key)` --- test/diagnostics/param-type-mismatch.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test/diagnostics') 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 @@ -90,6 +90,22 @@ f(t.y) 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 -- cgit v1.2.3