aboutsummaryrefslogtreecommitdiff
path: root/spec/outputs/nil_coalescing.lua
blob: 2279853ccffcba987abbbd68e582b7cd84491099 (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
do
	local a
	local _exp_0 = b
	if _exp_0 ~= nil then
		a = _exp_0
	else
		a = c
	end
end
do
	local a
	local _exp_0 = b
	if _exp_0 ~= nil then
		a = _exp_0.a
	else
		a = c.a
	end
end
do
	local a = func()
	if a == nil then
		a = false
	end
end
do
	local a
	if a == nil then
		a = func()
	end
end
do
	local a, b, c, d, e
	if b ~= nil then
		a = b
	else
		if c ~= nil then
			a = c
		else
			if d ~= nil then
				a = d
			else
				a = e
			end
		end
	end
end
do
	local a
	local _exp_0 = b
	if _exp_0 ~= nil then
		a = _exp_0
	else
		do
			local _exp_1 = c
			if _exp_1 ~= nil then
				a = _exp_1
			else
				do
					local _exp_2 = d
					if _exp_2 ~= nil then
						a = _exp_2
					else
						a = e
					end
				end
			end
		end
	end
end
do
	func((function()
		local _exp_0 = x
		if _exp_0 ~= nil then
			return _exp_0
		else
			return "hello"
		end
	end)())
end
do
	local _with_0
	local _exp_0 = funcA()
	if _exp_0 ~= nil then
		_with_0 = _exp_0
	else
		_with_0 = funcB()
	end
	print(_with_0.field)
end
do
	local a = 1 + 2 + (function()
		local _exp_0 = b
		if _exp_0 ~= nil then
			return _exp_0
		else
			return c + 3 + 4
		end
	end)()
end
do
	local a = 1 + 2 + ((function()
		local _exp_0 = b
		if _exp_0 ~= nil then
			return _exp_0
		else
			return c
		end
	end)()) + 3 + 4
end
do
	local a, b
	do
		local _obj_0 = func()
		a, b = _obj_0.a, _obj_0.b
	end
	a = a or 1
	if b == nil then
		do
			local _exp_0 = c
			if _exp_0 ~= nil then
				b = _exp_0
			else
				b = 2
			end
		end
	end
end
do
	local a
	local _exp_0 = 1
	if _exp_0 ~= nil then
		a = _exp_0
	else
		do
			local _exp_1 = 2
			if _exp_1 ~= nil then
				a = _exp_1
			else
				a = 3
			end
		end
	end
end
do
	local _obj_0 = a.b
	if _obj_0.c == nil then
		_obj_0.c = 1
	end
	local a
	do
		local _exp_0 = b.x
		if _exp_0 ~= nil then
			a = _exp_0
		else
			do
				local _exp_1 = c.x
				if _exp_1 ~= nil then
					a = _exp_1
				else
					a = d.x
				end
			end
		end
	end
	if a.c == nil then
		a.c = 1
	end
end
return nil