You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to define a list of functions of a certain type. I would expect this to work as follows:
--- @type (fun(a: b): c)[]
local funcList = {}
This throws an error <type set> expected, got '('
Note that --- @type fun(a: b): c[] is allowed, but this defines a singular function that returns a list of c, instead of a list of functions that each return a singular c.
A slightly looser definition with a table does work:
--- @type table<number, fun(a: b): c>
local funcList = {}
The text was updated successfully, but these errors were encountered:
I would like to define a list of functions of a certain type. I would expect this to work as follows:
This throws an error
<type set> expected, got '('
Note that
--- @type fun(a: b): c[]
is allowed, but this defines a singular function that returns a list of c, instead of a list of functions that each return a singular c.A slightly looser definition with a table does work:
The text was updated successfully, but these errors were encountered: