This gives the type parameter returned by getTypeParameterFromMappedType an accurate constraint. Fixes #27596.
7 lines
127 B
TypeScript
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;
|
|
}
|