Skip to content

Commit a88964e

Browse files
committed
fix infer
1 parent a1a5ac1 commit a88964e

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

script/vm/runner.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ function mt:_compileBlock(block)
177177
type = 'save',
178178
tag = 'block',
179179
copy = true,
180-
pos = block.start,
180+
pos = childBlock.start,
181181
}
182182
local outStep = {
183183
type = 'save',

test/type_inference/init.lua

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2191,3 +2191,29 @@ local x
21912191
21922192
print(<?x?>)
21932193
]]
2194+
2195+
TEST 'string' [[
2196+
---@type string?
2197+
local x
2198+
2199+
if not x then
2200+
return
2201+
else
2202+
print(<?x?>)
2203+
end
2204+
2205+
print(x)
2206+
]]
2207+
2208+
TEST 'string' [[
2209+
---@type string?
2210+
local x
2211+
2212+
if not x then
2213+
return
2214+
else
2215+
print(x)
2216+
end
2217+
2218+
print(<?x?>)
2219+
]]

0 commit comments

Comments
 (0)