File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -985,8 +985,7 @@ local compilerSwitch = util.switch()
985985 elseif src .value
986986 and src .value .type == ' binary'
987987 and src .value .op and src .value .op .type == ' or'
988- and src .value [1 ] and src .value [1 ].type == ' getlocal' and src .value [1 ].node == source
989- and src .value [2 ] and guide .isLiteral (src .value [2 ]) then
988+ and src .value [1 ] and src .value [1 ].type == ' getlocal' and src .value [1 ].node == source then
990989 -- x = x or 1
991990 vm .setNode (src , vm .compileNode (src .value ))
992991 else
Original file line number Diff line number Diff line change @@ -1841,6 +1841,13 @@ TEST 'integer' [[
18411841---@type integer?
18421842local x
18431843
1844+ <?x?> = x or y
1845+ ]]
1846+
1847+ TEST ' integer' [[
1848+ ---@type integer?
1849+ local x
1850+
18441851if not x then
18451852 return
18461853end
@@ -1947,6 +1954,6 @@ TEST 'integer' [[
19471954---@type integer?
19481955local x
19491956
1950- if x and <?x?>.y then
1957+ if x and <?x?> then
19511958end
19521959]]
You can’t perform that action at this time.
0 commit comments