mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 18:55:14 -07:00
fix(types): use vararg return type annotation
build(types): allow vararg returns in function types
This commit is contained in:
parent
c06f3dbe3e
commit
e947f226be
@ -4082,10 +4082,10 @@ Iter:map({f}) *Iter:map()*
|
|||||||
<
|
<
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
• {f} (`fun(...):any`) Mapping function. Takes all values returned from
|
• {f} (`fun(...):...:any`) Mapping function. Takes all values returned
|
||||||
the previous stage in the pipeline as arguments and returns one
|
from the previous stage in the pipeline as arguments and returns
|
||||||
or more new values, which are used in the next pipeline stage.
|
one or more new values, which are used in the next pipeline
|
||||||
Nil return values are filtered from the output.
|
stage. Nil return values are filtered from the output.
|
||||||
|
|
||||||
Return: ~
|
Return: ~
|
||||||
(`Iter`)
|
(`Iter`)
|
||||||
|
@ -276,7 +276,7 @@ end
|
|||||||
--- -- { 6, 12 }
|
--- -- { 6, 12 }
|
||||||
--- ```
|
--- ```
|
||||||
---
|
---
|
||||||
---@param f fun(...):any Mapping function. Takes all values returned from
|
---@param f fun(...):...:any Mapping function. Takes all values returned from
|
||||||
--- the previous stage in the pipeline as arguments
|
--- the previous stage in the pipeline as arguments
|
||||||
--- and returns one or more new values, which are used
|
--- and returns one or more new values, which are used
|
||||||
--- in the next pipeline stage. Nil return values
|
--- in the next pipeline stage. Nil return values
|
||||||
|
@ -178,7 +178,8 @@ local grammar = P {
|
|||||||
table_elem = v.table_key * colon * v.ltype,
|
table_elem = v.table_key * colon * v.ltype,
|
||||||
ty_table = Pf('{') * comma1(v.table_elem) * fill * P('}'),
|
ty_table = Pf('{') * comma1(v.table_elem) * fill * P('}'),
|
||||||
fun_param = lname * opt(colon * v.ltype),
|
fun_param = lname * opt(colon * v.ltype),
|
||||||
ty_fun = Pf('fun') * paren(comma(lname * opt(colon * v.ltype))) * opt(colon * comma1(v.ltype)),
|
fun_ret = v.ltype + (ident * colon * v.ltype) + (P('...') * opt(colon * v.ltype)),
|
||||||
|
ty_fun = Pf('fun') * paren(comma(lname * opt(colon * v.ltype))) * opt(colon * comma1(v.fun_ret)),
|
||||||
ty_generic = P('`') * letter * P('`'),
|
ty_generic = P('`') * letter * P('`'),
|
||||||
ty_tuple = Pf('[') * comma(v.ltype) * fill * P(']'),
|
ty_tuple = Pf('[') * comma(v.ltype) * fill * P(']'),
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user