5 lines
123 B
TypeScript
5 lines
123 B
TypeScript
|
function foo<T extends { m(p: string): number }>(x: T): T {
|
||
|
return undefined;
|
||
|
}
|
||
|
|
||
|
foo({ m(x) { return x.length } });
|