diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/diagnostics/common.lua | 6 | ||||
-rw-r--r-- | test/diagnostics/type-check.lua | 7 |
2 files changed, 10 insertions, 3 deletions
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, <!4!>) +m.x(m, 2, 3, <!4!>) ]] TEST [[ @@ -469,7 +469,7 @@ local mt = {} function mt:f(a, b) return a, b end -mt.f(1, 2, 3, <!4!>) +mt.f(mt, 2, 3, <!4!>) ]] @@ -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 <!m.x!> = {} ]] +TEST [[ +---@param x number +local function f(x) end + +f(<!true!>) +]] + config.remove(nil, 'Lua.diagnostics.disable', 'unused-local') config.remove(nil, 'Lua.diagnostics.disable', 'undefined-global') |