2014-07-13 01:04:16 +02:00
|
|
|
//// [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]
|
2015-03-26 21:46:35 +01:00
|
|
|
var e = function (x, y) { return x.length; };
|
2014-08-15 22:18:54 +02:00
|
|
|
var r99 = map(e); // should be {}[] for S since a generic lambda is not inferentially typed
|
2015-03-26 21:46:35 +01:00
|
|
|
var e2 = function (x, y) { return x.length; };
|
2014-08-15 23:32:08 +02:00
|
|
|
var r100 = map2(e2); // type arg inference should fail for S since a generic lambda is not inferentially typed. Falls back to { length: number }
|