Skip to content

Commit 6f52414

Browse files
committed
fix
1 parent ffc8917 commit 6f52414

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

script/vm/runner.lua

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,8 @@ function mt:_lookIntoChild(action, topNode, outNode)
140140
goto RETURN
141141
end
142142
if action.op.type == 'and' then
143-
local dummyNode = topNode:copy()
144-
topNode = self:_lookIntoChild(action[1], topNode, dummyNode)
145-
topNode = self:_lookIntoChild(action[2], topNode, dummyNode)
143+
topNode = self:_lookIntoChild(action[1], topNode, topNode:copy())
144+
topNode = self:_lookIntoChild(action[2], topNode, topNode:copy())
146145
elseif action.op.type == 'or' then
147146
outNode = outNode or topNode:copy()
148147
local topNode1, outNode1 = self:_lookIntoChild(action[1], topNode, outNode)

test/type_inference/init.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1857,6 +1857,15 @@ if xxx and x then
18571857
end
18581858
]]
18591859

1860+
TEST 'integer' [[
1861+
---@type integer?
1862+
local x
1863+
1864+
if x and not mark[x] then
1865+
print(<?x?>)
1866+
end
1867+
]]
1868+
18601869
TEST 'integer?' [[
18611870
---@type integer?
18621871
local x

0 commit comments

Comments
 (0)