I can't get this simple code snippet to compile in Typescript (1.8)
function test<T>(a: string, input: T): T {
return input
}
const xyz: (a: string, b: number) => number = test<number>
I have a function that takes a delegate, but converting the generics function into that delegate format requires me to perform this extra step:
const xyz: (a: string, b: number) => number = (a,b) => test<number>(a,b)
... which does not seem ideal to me. Any ideas why this does not work, or if there is another syntax to accomplish the same?