Skip to content

Commit 3154cef

Browse files
committed
fix #1887
1 parent 4943e05 commit 3154cef

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

changelog.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
## 3.6.11
44
* `CHG` completion: don't show loading process
55
* `FIX` [#1886]
6-
* `FIX` [#1895]
6+
* `FIX` [#1887]
77
* `FIX` [#1889]
8+
* `FIX` [#1895]
89

910
[#1886]: https://github.com/LuaLS/lua-language-server/issues/1886
10-
[#1895]: https://github.com/LuaLS/lua-language-server/issues/1895
11+
[#1887]: https://github.com/LuaLS/lua-language-server/issues/1887
1112
[#1889]: https://github.com/LuaLS/lua-language-server/issues/1889
13+
[#1895]: https://github.com/LuaLS/lua-language-server/issues/1895
1214

1315
## 3.6.10
1416
`2023-2-7`

script/vm/tracer.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,10 @@ local lookIntoChild = util.switch()
282282
---@param topNode vm.node
283283
---@param outNode? vm.node
284284
: call(function (tracer, action, topNode, outNode)
285+
if action.type == 'loop' then
286+
tracer:lookIntoChild(action.init, topNode)
287+
tracer:lookIntoChild(action.max, topNode)
288+
end
285289
if action[1] then
286290
tracer:lookIntoBlock(action, action.bstart, topNode:copy())
287291
local lastAssign = tracer:getLastAssign(action.start, action.finish)

test/type_inference/init.lua

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4219,3 +4219,17 @@ end
42194219
function Y()
42204220
end
42214221
]]
4222+
4223+
TEST 'A_Class' [[
4224+
---@class A_Class
4225+
local A = { x = 5 }
4226+
4227+
function A:func()
4228+
for i = 1, <?self?>.x do
4229+
print(i)
4230+
end
4231+
4232+
self.y = 3
4233+
self.y = self.y + 3
4234+
end
4235+
]]

0 commit comments

Comments
 (0)