Skip to content

Commit 7155b72

Browse files
committed
fix
1 parent 664a5c7 commit 7155b72

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

script/vm/tracer.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -454,13 +454,13 @@ end
454454
function mt:lookIntoBlock(block, start, node)
455455
self:resetCastsIndex(start)
456456
for _, action in ipairs(block) do
457-
if action.start < start then
457+
if (action.effect or action.start) < start then
458458
goto CONTINUE
459459
end
460460
if self.careMap[action] then
461461
node = self:lookIntoChild(action, node)
462462
end
463-
if self.assignMap[action] then
463+
if action.finish > start and self.assignMap[action] then
464464
break
465465
end
466466
::CONTINUE::
@@ -472,7 +472,7 @@ function mt:calcNode(source)
472472
if source.type == 'getlocal' then
473473
local lastAssign = self:getLastAssign(0, source.start)
474474
if not lastAssign then
475-
return
475+
lastAssign = source.node
476476
end
477477
self:calcNode(lastAssign)
478478
return

test/type_inference/init.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4074,3 +4074,9 @@ else
40744074
print(<?t?>)
40754075
end
40764076
]]
4077+
4078+
TEST 'function' [[
4079+
local function x()
4080+
print(<?x?>)
4081+
end
4082+
]]

0 commit comments

Comments
 (0)