diff options
Diffstat (limited to 'test/diagnostics')
-rw-r--r-- | test/diagnostics/common.lua | 2 | ||||
-rw-r--r-- | test/diagnostics/type-check.lua | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/test/diagnostics/common.lua b/test/diagnostics/common.lua index 7c2ffb60..760f1f6f 100644 --- a/test/diagnostics/common.lua +++ b/test/diagnostics/common.lua @@ -646,7 +646,7 @@ end!> ]] TEST [[ -<!for _ in pairs(_VERSION) do +<!for _ in pairs({}) do end!> ]] diff --git a/test/diagnostics/type-check.lua b/test/diagnostics/type-check.lua index f0133501..7a39d7dc 100644 --- a/test/diagnostics/type-check.lua +++ b/test/diagnostics/type-check.lua @@ -865,6 +865,17 @@ local t = { t.x = 1 ]] +TEST [[ +---@generic T: string | boolean | table +---@param x T +---@return T +local function f(x) + return x +end + +f(<!1!>) +]] + config.remove(nil, 'Lua.diagnostics.disable', 'unused-local') config.remove(nil, 'Lua.diagnostics.disable', 'unused-function') config.remove(nil, 'Lua.diagnostics.disable', 'undefined-global') |