aboutsummaryrefslogtreecommitdiff
path: root/spec/outputs/nil_coalesce_precedence.lua
blob: 6f353ee5fa318b559001eae7e6cc46a0974f8b49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
local a = nil
local b = false
local c = 0
local x
if a ~= nil then
	x = a
else
	do
		local _exp_0 = (b and 1)
		if _exp_0 ~= nil then
			x = _exp_0
		else
			x = (c or 2)
		end
	end
end
local y = ((function()
	if a ~= nil then
		return a
	else
		return b
	end
end)()) and 1 or 2
return print(x, y)