2014-07-13 01:04:16 +02:00
|
|
|
/// <reference path="fourslash.ts" />
|
|
|
|
|
|
|
|
////interface Iterator<T, U> {
|
|
|
|
//// (value: T, index: any, list: any): U;
|
|
|
|
////}
|
|
|
|
////interface WrappedArray<T> {
|
|
|
|
//// map<U>(iterator: Iterator<T, U>, context?: any): U[];
|
|
|
|
////}
|
|
|
|
////interface Underscore {
|
|
|
|
//// <T>(list: T[]): WrappedArray<T>;
|
|
|
|
//// map<T, U>(list: T[], iterator: Iterator<T, U>, context?: any): U[];
|
|
|
|
////}
|
|
|
|
////declare var _: Underscore;
|
|
|
|
////var aa: string[];
|
|
|
|
////var b/*1*/b = _.map(aa, x/*7*/x => xx.length); // should be number[]
|
|
|
|
////var c/*2*/c = _(aa).map(x/*8*/x => xx.length); // should be number[]
|
|
|
|
////var d/*3*/d = aa.map(xx => x/*9*/x.length); // should be number[]
|
|
|
|
////var aaa: any[];
|
|
|
|
////var b/*4*/bb = _.map(aaa, xx => xx.length); // should be any[]
|
|
|
|
////var c/*5*/cc = _(aaa).map(xx => xx.length); // Should not error, should be any[]
|
|
|
|
////var d/*6*/dd = aaa.map(xx => xx.length); // should not error, should be any[]
|
|
|
|
|
|
|
|
verify.numberOfErrorsInCurrentFile(0);
|
|
|
|
goTo.marker('1');
|
2014-10-07 20:30:27 +02:00
|
|
|
verify.quickInfoIs('(var) bb: number[]');
|
2014-07-13 01:04:16 +02:00
|
|
|
|
|
|
|
goTo.marker('2');
|
2014-10-07 20:30:27 +02:00
|
|
|
verify.quickInfoIs('(var) cc: number[]');
|
2014-07-13 01:04:16 +02:00
|
|
|
|
|
|
|
goTo.marker('3');
|
2014-10-07 20:30:27 +02:00
|
|
|
verify.quickInfoIs('(var) dd: number[]');
|
2014-07-13 01:04:16 +02:00
|
|
|
|
|
|
|
goTo.marker('4');
|
2014-10-07 20:30:27 +02:00
|
|
|
verify.quickInfoIs('(var) bbb: any[]');
|
2014-07-13 01:04:16 +02:00
|
|
|
|
|
|
|
goTo.marker('5');
|
2014-10-07 20:30:27 +02:00
|
|
|
verify.quickInfoIs('(var) ccc: any[]');
|
2014-07-13 01:04:16 +02:00
|
|
|
|
|
|
|
goTo.marker('6');
|
2014-10-07 20:30:27 +02:00
|
|
|
verify.quickInfoIs('(var) ddd: any[]');
|
2014-07-13 01:04:16 +02:00
|
|
|
|
|
|
|
goTo.marker('7');
|
2014-10-07 20:30:27 +02:00
|
|
|
verify.quickInfoIs('(parameter) xx: string');
|
2014-07-13 01:04:16 +02:00
|
|
|
|
|
|
|
goTo.marker('8');
|
2014-10-07 20:30:27 +02:00
|
|
|
verify.quickInfoIs('(parameter) xx: string');
|
2014-07-13 01:04:16 +02:00
|
|
|
|
|
|
|
goTo.marker('9');
|
2014-10-07 20:30:27 +02:00
|
|
|
verify.quickInfoIs('(parameter) xx: string');
|