Open
Description
Currently, the only way to document generic functions is to use @generic
. and it's not possible to use them in overloads or fields.
The following examples are invalid:
---@generic T
---@param arg1 string
---@param arg2 T
---@return T
---@overload fun(arg2: T) <- Undefined type or alias `T`.
local function foo(arg1, arg2)
return arg2 or arg1
end
---@class Foo
---@field bar fun<T>(arg:T): T <- `(` expected.
local Foo = {}