2014-07-13 01:04:16 +02:00
|
|
|
/// <reference path='fourslash.ts'/>
|
|
|
|
|
|
|
|
////interface Collection<T> {
|
|
|
|
//// length: number;
|
|
|
|
//// add(x: T): void;
|
|
|
|
//// remove(x: T): boolean;
|
|
|
|
////}
|
|
|
|
////interface Combinators {
|
|
|
|
//// forEach<T>(c: Collection<T>, f: (x: T) => any): void;
|
|
|
|
//// forEach<T, U>(c: Collection<T>, f: (x: T) => U): void;
|
|
|
|
////}
|
|
|
|
////var c2: Collection<number>;
|
|
|
|
////var c3: Collection<Collection<number>>;
|
|
|
|
////var _: Combinators;
|
|
|
|
////var r = _.forEach(c2, (x) => { return x./*1*/toFixed() });
|
2018-05-01 22:00:13 +02:00
|
|
|
////var r2 = _.forEach(c3, (x) => { return x./*2*/toFixed() });
|
2014-07-13 01:04:16 +02:00
|
|
|
/////*3*/
|
|
|
|
|
2018-05-01 22:00:13 +02:00
|
|
|
const verifyCompletions = () =>
|
|
|
|
verify.completions(
|
2018-05-03 22:04:08 +02:00
|
|
|
{ marker: "1", includes: "toFixed" },
|
|
|
|
{ marker: "2", exact: ["length", "add", "remove"] },
|
2018-05-01 22:00:13 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
verifyCompletions();
|
2014-07-13 01:04:16 +02:00
|
|
|
|
|
|
|
goTo.marker('3');
|
2018-05-01 22:00:13 +02:00
|
|
|
edit.insert(`class A {
|
|
|
|
foo() { }
|
|
|
|
}
|
|
|
|
var c4: Collection<A>;
|
|
|
|
var r3 = _.forEach(c4, (x) => { return x.foo() });
|
|
|
|
`);
|
2014-07-13 01:04:16 +02:00
|
|
|
|
2018-05-01 22:00:13 +02:00
|
|
|
verifyCompletions();
|