File: inferentialTypingObjectLiteralMethod2.js

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (9 lines) | stat: -rw-r--r-- 411 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
//// [inferentialTypingObjectLiteralMethod2.ts]
interface Int<T, U> {
    [s: string]: (x: T) => U;
}
declare function foo<T, U>(x: T, y: Int<T, U>, z: Int<U, T>): T;
foo("", { method(p1) { return p1.length } }, { method(p2) { return undefined } });

//// [inferentialTypingObjectLiteralMethod2.js]
foo("", { method: function (p1) { return p1.length; } }, { method: function (p2) { return undefined; } });