diff options
-rw-r--r-- | changelog.md | 1 | ||||
-rw-r--r-- | script/core/noder.lua | 3 | ||||
-rw-r--r-- | test/type_inference/init.lua | 16 |
3 files changed, 18 insertions, 2 deletions
diff --git a/changelog.md b/changelog.md index 854f7c2f..7519281f 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,7 @@ ## 2.4.10 * `FIX` [#790](https://github.com/sumneko/lua-language-server/issues/790) +* `FIX` [#798](https://github.com/sumneko/lua-language-server/issues/798) ## 2.4.9 `2021-11-18` diff --git a/script/core/noder.lua b/script/core/noder.lua index cdf2c710..3a8b9fe2 100644 --- a/script/core/noder.lua +++ b/script/core/noder.lua @@ -1412,8 +1412,7 @@ compileNodeMap = util.switch() end for _, rtn in ipairs(source.returns) do for _, src in ipairs(source.bindSources) do - if src.type == 'function' - or guide.isSet(src) then + if src.type == 'function' then local fullID = sformat('%s%s%s' , getID(src) , RETURN_INDEX diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index 908d613c..5526d6d8 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -943,3 +943,19 @@ local x <?x?> = 1 ]] + +TEST 'any' [[ +---@return number +local function f(x) + local <?y?> = x() +end +]] + +TEST 'any' [[ +local mt + +---@return number +function mt:f() end + +local <?v?> = mt() +]] |