diff options
-rw-r--r-- | changelog.md | 1 | ||||
-rw-r--r-- | script/vm/runner.lua | 10 | ||||
-rw-r--r-- | test/type_inference/init.lua | 13 |
3 files changed, 20 insertions, 4 deletions
diff --git a/changelog.md b/changelog.md index 5d5de00a..bef611ac 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,7 @@ # changelog ## 3.3.1 +* `FIX` [#1213](https://github.com/sumneko/lua-language-server/issues/1213) * `FIX` [#1215](https://github.com/sumneko/lua-language-server/issues/1215) ## 3.3.0 diff --git a/script/vm/runner.lua b/script/vm/runner.lua index 793b4417..2de06aaa 100644 --- a/script/vm/runner.lua +++ b/script/vm/runner.lua @@ -296,10 +296,12 @@ function mt:_lookInto(action, topNode, outNode) end elseif action.type == 'paren' then topNode, outNode = self:_lookInto(action.exp, topNode, outNode) - else - guide.eachSourceContain(action, top.finish, function(source) - self:_lookInto(source, topNode) - end) + elseif action.type == 'return' then + for _, rtn in ipairs(action) do + self:_lookInto(rtn, topNode) + end + elseif action.type == 'getindex' then + self:_lookInto(action.index, topNode) end ::RETURN:: topNode = self:_fastWard(action.finish, topNode) diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index 8201f9d4..32a35fbd 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -2637,3 +2637,16 @@ else print(<?x?>) end ]] + +TEST 'B' [[ +---@class A +---@class B + +---@type A +local x + +---@type B +x = call(x) + +print(<?x?>) +]] |