TypeScript/tests/cases/compiler/typeParameterConstraintInstantiation.ts
Anders Hejlsberg 3055445d27 Adding test
2015-12-10 13:54:58 -08:00

9 lines
229 B
TypeScript

// Check that type parameter constraints are properly instantiated
interface Mapper<T> {
map<U extends T, V extends U[]>(f: (item: T) => U): V;
}
var m: Mapper<string>;
var a = m.map((x: string) => x); // string[]