File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -172,6 +172,44 @@ local v = 'y'
172172local <?r?> = f(v)
173173]]
174174
175+ TEST ' string|number' [[
176+ ---@overload fun(a: string)
177+ ---@overload fun(a: number)
178+ local function f(<?a?>) end
179+ ]]
180+
181+ TEST ' 1|2' [[
182+ ---@overload fun(a: 1)
183+ ---@overload fun(a: 2)
184+ local function f(<?a?>) end
185+ ]]
186+
187+ TEST ' string' [[
188+ ---@overload fun(a: 1): string
189+ ---@overload fun(a: 2): number
190+ local function f(a) end
191+
192+ local <?r?> = f(1)
193+ ]]
194+
195+ TEST ' number' [[
196+ ---@overload fun(a: 1): string
197+ ---@overload fun(a: 2): number
198+ local function f(a) end
199+
200+ local <?r?> = f(2)
201+ ]]
202+
203+ TEST ' string|number' [[
204+ ---@overload fun(a: 1): string
205+ ---@overload fun(a: 2): number
206+ local function f(a) end
207+
208+ ---@type number
209+ local v
210+ local <?r?> = f(v)
211+ ]]
212+
175213TEST ' number' [[
176214---@overload fun(a: 1, c: fun(x: number))
177215---@overload fun(a: 2, c: fun(x: string))
You can’t perform that action at this time.
0 commit comments