TypeScript/tests/cases/compiler/inferentialTypingObjectLiteralMethod1.ts

5 lines
196 B
TypeScript
Raw Normal View History

2015-05-29 01:02:38 +02:00
interface Int<T, U> {
method(x: T): U;
}
declare function foo<T, U>(x: T, y: Int<T, U>, z: Int<U, T>): T;
2015-05-21 01:38:13 +02:00
foo("", { method(p1) { return p1.length } }, { method(p2) { return undefined } });