Skip to content

Commit a525372

Browse files
committed
fix
1 parent 08b9dd3 commit a525372

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

script/vm/value.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ function vm.testCondition(source)
99
return nil
1010
end
1111
local node = vm.compileNode(source)
12+
if node.optional then
13+
return nil
14+
end
1215
local hasTrue, hasFalse
1316
for n in node:eachObject() do
1417
if n.type == 'boolean'

test/type_inference/init.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3209,3 +3209,12 @@ local n
32093209
32103210
print(<?n?>)
32113211
]]
3212+
3213+
TEST 'integer' [[
3214+
---@type integer?
3215+
local n
3216+
if true then
3217+
n = 0
3218+
end
3219+
local <?x?> = n or 0
3220+
]]

0 commit comments

Comments
 (0)