TypeScript/tests/cases/compiler/inferentialTypingUsingApparentType2.ts

5 lines
123 B
TypeScript
Raw Normal View History

2015-07-03 00:21:43 +02:00
function foo<T extends { m(p: string): number }>(x: T): T {
return undefined;
}
foo({ m(x) { return x.length } });