diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2023-03-08 21:32:39 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2023-03-08 21:32:39 +0800 |
commit | c6820ed9972fe26594c1661d3887fb1d9a6dda1e (patch) | |
tree | 8835a7e2f4c66ae80d33a4ab36e8e76617989a1e /script/core | |
parent | dcfc5d24708643bc2e41f49f227580716a2103a2 (diff) | |
download | lua-language-server-c6820ed9972fe26594c1661d3887fb1d9a6dda1e.zip |
should check type of `self`
fix #1922
Diffstat (limited to 'script/core')
-rw-r--r-- | script/core/diagnostics/param-type-mismatch.lua | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/script/core/diagnostics/param-type-mismatch.lua b/script/core/diagnostics/param-type-mismatch.lua index 607d4b0e..da39c5e1 100644 --- a/script/core/diagnostics/param-type-mismatch.lua +++ b/script/core/diagnostics/param-type-mismatch.lua @@ -87,9 +87,6 @@ return function (uri, callback) await.delay() local funcNode = vm.compileNode(source.node) for i, arg in ipairs(source.args) do - if i == 1 and source.node.type == 'getmethod' then - goto CONTINUE - end local refNode = vm.compileNode(arg) if not refNode then goto CONTINUE @@ -99,7 +96,8 @@ return function (uri, callback) goto CONTINUE end if arg.type == 'getfield' - or arg.type == 'getindex' then + or arg.type == 'getindex' + or arg.type == 'self' then -- 由于无法对字段进行类型收窄, -- 因此将假值移除再进行检查 refNode = refNode:copy():setTruthy() |