diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-01-05 21:10:28 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-01-05 21:10:28 +0800 |
commit | 81651a70bf8e8e45e829c7a1a2a7d7bd46bb805b (patch) | |
tree | d65087b5ef2d72504ebfd289fd2bcc2679464f76 /script/core | |
parent | 2d7927e421b46b6f9103b58cff262205fd0fb7a5 (diff) | |
download | lua-language-server-81651a70bf8e8e45e829c7a1a2a7d7bd46bb805b.zip |
fix `not-yieldable`
Diffstat (limited to 'script/core')
-rw-r--r-- | script/core/diagnostics/not-yieldable.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/script/core/diagnostics/not-yieldable.lua b/script/core/diagnostics/not-yieldable.lua index 465f6a8b..5736b1e2 100644 --- a/script/core/diagnostics/not-yieldable.lua +++ b/script/core/diagnostics/not-yieldable.lua @@ -9,9 +9,9 @@ local function isYieldAble(defs, i) local hasFuncDef for _, def in ipairs(defs) do if def.type == 'function' then - hasFuncDef = true local arg = def.args and def.args[i] if arg then + hasFuncDef = true if infer.hasType(arg, 'any') or vm.isAsync(arg, true) or arg.type == '...' then @@ -20,9 +20,9 @@ local function isYieldAble(defs, i) end end if def.type == 'doc.type.function' then - hasFuncDef = true local arg = def.args and def.args[i] if arg then + hasFuncDef = true if infer.hasType(arg.extends, 'any') or vm.isAsync(arg.extends, true) then return true |