I have this generic type to create function types using variadics:
type GetFunctionType<U...> = (U...) -> ()
local example: GetFunctionType<string, number, boolean> = nil
-- typeof(example) == (_: string, _: number, _: boolean) -> ()
I was wondering if I could make the parameter names anything but _. I have tried this:
type GetFunctionType<Names..., Types...> = (Names...:Types...) -> ()
local example: GetFunctionType<(First, Second), string, boolean> = nil
-- type error
But it doesn’t work. Is there a way to do this?