diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-06-22 16:13:50 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-06-22 16:13:50 +0800 |
commit | e5d692cb0845e5de7988904017440bd4db551bb7 (patch) | |
tree | dcfad1a5b739f3f7987d2baf5c4d6979b754b78f /test | |
parent | 82c3b68c6b80f754aa9fc12a4f029eba237e2807 (diff) | |
download | lua-language-server-e5d692cb0845e5de7988904017440bd4db551bb7.zip |
`param-type-mismatch`
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') |