Skip to content

Commit 073afa5

Browse files
committed
fix #1213 change back to enum
1 parent 182b2b7 commit 073afa5

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# changelog
22

33
## 3.3.1
4+
* `FIX` [#1213](https://github.com/sumneko/lua-language-server/issues/1213)
45
* `FIX` [#1215](https://github.com/sumneko/lua-language-server/issues/1215)
56

67
## 3.3.0

script/vm/runner.lua

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,12 @@ function mt:_lookInto(action, topNode, outNode)
296296
end
297297
elseif action.type == 'paren' then
298298
topNode, outNode = self:_lookInto(action.exp, topNode, outNode)
299-
else
300-
guide.eachSourceContain(action, top.finish, function(source)
301-
self:_lookInto(source, topNode)
302-
end)
299+
elseif action.type == 'return' then
300+
for _, rtn in ipairs(action) do
301+
self:_lookInto(rtn, topNode)
302+
end
303+
elseif action.type == 'getindex' then
304+
self:_lookInto(action.index, topNode)
303305
end
304306
::RETURN::
305307
topNode = self:_fastWard(action.finish, topNode)

test/type_inference/init.lua

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2637,3 +2637,16 @@ else
26372637
print(<?x?>)
26382638
end
26392639
]]
2640+
2641+
TEST 'B' [[
2642+
---@class A
2643+
---@class B
2644+
2645+
---@type A
2646+
local x
2647+
2648+
---@type B
2649+
x = call(x)
2650+
2651+
print(<?x?>)
2652+
]]

0 commit comments

Comments
 (0)