Assigning arrow function to generic function type with TypeScript
问题 I've done some digging on similar questions but I cannot find a solution that works. I've got some types of generic functions, but I cannot seem to implement them correctly. In short, I have this: /** Takes three values of the same type and collapses them into one */ declare type MergeFunction = <T>(def: T, file?: T, arg?: T) => T /** The implementation I'm having trouble with. Merge three arrays of the same type. */ const arrayMerge: MergeFunction = <T>(def: T[], file: T[] = [], arg: T[] = [