TypeScript/tests/baselines/reference/contextualSignatureInstantiation1.js
Sheetal Nandi 6ab3adfd43 Modified the emitComment logic to handle emitting leading or trailing spaces depending on flags
Leading comments have trailing separator while trailing comments have leading space
This removes the extra trailing space in the trailing comments
2014-08-15 14:32:08 -07:00

15 lines
902 B
JavaScript

//// [contextualSignatureInstantiation1.ts]
declare function map<S, T>(f: (x: S) => T): (a: S[]) => T[];
var e = <K>(x: string, y?: K) => x.length;
var r99 = map(e); // should be {}[] for S since a generic lambda is not inferentially typed
declare function map2<S extends { length: number }, T>(f: (x: S) => T): (a: S[]) => T[];
var e2 = <K>(x: string, y?: K) => x.length;
var r100 = map2(e2); // type arg inference should fail for S since a generic lambda is not inferentially typed. Falls back to { length: number }
//// [contextualSignatureInstantiation1.js]
var e = function (x, y) { return x.length; };
var r99 = map(e); // should be {}[] for S since a generic lambda is not inferentially typed
var e2 = function (x, y) { return x.length; };
var r100 = map2(e2); // type arg inference should fail for S since a generic lambda is not inferentially typed. Falls back to { length: number }