TypeScript/tests/cases/compiler/mappedTypeParameterConstraint.ts
Matt McCutchen d19fb98ec6 When instantiating a mapped type, clone the type parameter. (#27597)
This gives the type parameter returned by getTypeParameterFromMappedType
an accurate constraint.

Fixes #27596.
2018-10-11 15:45:51 -07:00

7 lines
127 B
TypeScript

// Repro for #27596
type MyMap<T> = {[P in keyof T]: T[keyof T]};
function foo<U>(arg: U): MyMap<U> {
return arg;
}