Hi guys, I've got such a code (message below)
I'm trying to write function with such a signature, but TS does not infer the types, although I was hoping it would. Does anyone know how could I fix it to maintain compile-time check between the input and output type?
function handleRequest<T extends MyRequest>(request: T): RequestToResponseMap[T['type']] { ... }