Skip to content

Commit bc43697

Browse files
committed
fix
1 parent ef7d403 commit bc43697

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

script/vm/tracer.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ function mt:lookIntoChild(action, topNode, outNode)
362362
local mainNode = topNode:copy()
363363
local blockNodes = {}
364364
for _, subBlock in ipairs(action) do
365+
self:fastWardCasts(subBlock.start, mainNode)
365366
local blockNode = mainNode:copy()
366367
if subBlock.filter then
367368
blockNode, mainNode = self:lookIntoChild(subBlock.filter, blockNode, mainNode)

test/type_inference/init.lua

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4075,6 +4075,19 @@ else
40754075
end
40764076
]]
40774077

4078+
TEST 'A|B' [[
4079+
---@class A
4080+
---@class B
4081+
4082+
---@type A|B
4083+
local t
4084+
4085+
if x then
4086+
---@cast t A
4087+
elseif <?t?> then
4088+
end
4089+
]]
4090+
40784091
TEST 'function' [[
40794092
local function x()
40804093
print(<?x?>)

0 commit comments

Comments
 (0)