From e5d692cb0845e5de7988904017440bd4db551bb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 22 Jun 2022 16:13:50 +0800 Subject: `param-type-mismatch` --- test/diagnostics/common.lua | 6 +++--- test/diagnostics/type-check.lua | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/diagnostics/common.lua b/test/diagnostics/common.lua index 7d745039..5de7d5db 100644 --- a/test/diagnostics/common.lua +++ b/test/diagnostics/common.lua @@ -239,7 +239,7 @@ local m = {} function m:x(a, b) return a, b end -m.x(1, 2, 3, ) +m.x(m, 2, 3, ) ]] TEST [[ @@ -469,7 +469,7 @@ local mt = {} function mt:f(a, b) return a, b end -mt.f(1, 2, 3, ) +mt.f(mt, 2, 3, ) ]] @@ -569,7 +569,7 @@ local m = {} function m:open() end -m.open('ok') +m.open(m) ]] TEST [[ diff --git a/test/diagnostics/type-check.lua b/test/diagnostics/type-check.lua index 20c611ab..3e4584c0 100644 --- a/test/diagnostics/type-check.lua +++ b/test/diagnostics/type-check.lua @@ -310,5 +310,12 @@ m.x = 1 = {} ]] +TEST [[ +---@param x number +local function f(x) end + +f() +]] + config.remove(nil, 'Lua.diagnostics.disable', 'unused-local') config.remove(nil, 'Lua.diagnostics.disable', 'undefined-global') -- cgit v1.2.3