Skip to content

Commit e52ba9e

Browse files
committed
update tests
1 parent 8067915 commit e52ba9e

File tree

108 files changed

+586
-759
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+586
-759
lines changed

tests/baselines/reference/2dArrays.types

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ class Board {
2424

2525
return this.ships.every(function (val) { return val.isSunk; });
2626
>this.ships.every(function (val) { return val.isSunk; }) : boolean
27-
>this.ships.every : { <S extends Ship>(predicate: (value: Ship, index: number, array: readonly Ship[]) => value is S, thisArg?: any): this is readonly S[]; (predicate: (value: Ship, index: number, array: readonly Ship[]) => unknown, thisArg?: any): boolean; }
27+
>this.ships.every : { <S extends Ship>(predicate: (value: Ship, index: number, array: Ship[]) => value is S, thisArg?: any): this is readonly S[]; (predicate: (value: Ship, index: number, array: Ship[]) => unknown, thisArg?: any): boolean; }
2828
>this.ships : Ship[]
2929
>this : this
3030
>ships : Ship[]
31-
>every : { <S extends Ship>(predicate: (value: Ship, index: number, array: readonly Ship[]) => value is S, thisArg?: any): this is readonly S[]; (predicate: (value: Ship, index: number, array: readonly Ship[]) => unknown, thisArg?: any): boolean; }
31+
>every : { <S extends Ship>(predicate: (value: Ship, index: number, array: Ship[]) => value is S, thisArg?: any): this is readonly S[]; (predicate: (value: Ship, index: number, array: Ship[]) => unknown, thisArg?: any): boolean; }
3232
>function (val) { return val.isSunk; } : (val: Ship) => boolean
3333
>val : Ship
3434
>val.isSunk : boolean
3535
>val : Ship
3636
>isSunk : boolean
37-
}
37+
}
3838
}

tests/baselines/reference/anyInferenceAnonymousFunctions.types

+10-10
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ var paired: any[];
44

55
paired.reduce(function (a1, a2) {
66
>paired.reduce(function (a1, a2) { return a1.concat({});} , []) : any
7-
>paired.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: readonly any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: readonly any[]) => any, initialValue: any): any; <U>(callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: readonly any[]) => U, initialValue: U): U; }
7+
>paired.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; <U>(callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; }
88
>paired : any[]
9-
>reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: readonly any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: readonly any[]) => any, initialValue: any): any; <U>(callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: readonly any[]) => U, initialValue: U): U; }
9+
>reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; <U>(callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; }
1010
>function (a1, a2) { return a1.concat({});} : (a1: any, a2: any) => any
1111
>a1 : any
1212
>a2 : any
@@ -23,9 +23,9 @@ paired.reduce(function (a1, a2) {
2323

2424
paired.reduce((b1, b2) => {
2525
>paired.reduce((b1, b2) => { return b1.concat({});} , []) : any
26-
>paired.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: readonly any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: readonly any[]) => any, initialValue: any): any; <U>(callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: readonly any[]) => U, initialValue: U): U; }
26+
>paired.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; <U>(callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; }
2727
>paired : any[]
28-
>reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: readonly any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: readonly any[]) => any, initialValue: any): any; <U>(callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: readonly any[]) => U, initialValue: U): U; }
28+
>reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; <U>(callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; }
2929
>(b1, b2) => { return b1.concat({});} : (b1: any, b2: any) => any
3030
>b1 : any
3131
>b2 : any
@@ -42,9 +42,9 @@ paired.reduce((b1, b2) => {
4242

4343
paired.reduce((b3, b4) => b3.concat({}), []);
4444
>paired.reduce((b3, b4) => b3.concat({}), []) : any
45-
>paired.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: readonly any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: readonly any[]) => any, initialValue: any): any; <U>(callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: readonly any[]) => U, initialValue: U): U; }
45+
>paired.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; <U>(callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; }
4646
>paired : any[]
47-
>reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: readonly any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: readonly any[]) => any, initialValue: any): any; <U>(callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: readonly any[]) => U, initialValue: U): U; }
47+
>reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; <U>(callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; }
4848
>(b3, b4) => b3.concat({}) : (b3: any, b4: any) => any
4949
>b3 : any
5050
>b4 : any
@@ -57,9 +57,9 @@ paired.reduce((b3, b4) => b3.concat({}), []);
5757

5858
paired.map((c1) => c1.count);
5959
>paired.map((c1) => c1.count) : any[]
60-
>paired.map : <U>(callbackfn: (value: any, index: number, array: readonly any[]) => U, thisArg?: any) => U[]
60+
>paired.map : <U>(callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[]
6161
>paired : any[]
62-
>map : <U>(callbackfn: (value: any, index: number, array: readonly any[]) => U, thisArg?: any) => U[]
62+
>map : <U>(callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[]
6363
>(c1) => c1.count : (c1: any) => any
6464
>c1 : any
6565
>c1.count : any
@@ -68,9 +68,9 @@ paired.map((c1) => c1.count);
6868

6969
paired.map(function (c2) { return c2.count; });
7070
>paired.map(function (c2) { return c2.count; }) : any[]
71-
>paired.map : <U>(callbackfn: (value: any, index: number, array: readonly any[]) => U, thisArg?: any) => U[]
71+
>paired.map : <U>(callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[]
7272
>paired : any[]
73-
>map : <U>(callbackfn: (value: any, index: number, array: readonly any[]) => U, thisArg?: any) => U[]
73+
>map : <U>(callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[]
7474
>function (c2) { return c2.count; } : (c2: any) => any
7575
>c2 : any
7676
>c2.count : any

tests/baselines/reference/argumentsAsPropertyName.types

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ function myFunction(myType: MyType) {
4040

4141
[1, 2, 3].forEach(function(j) { use(x); })
4242
>[1, 2, 3].forEach(function(j) { use(x); }) : void
43-
>[1, 2, 3].forEach : (callbackfn: (value: number, index: number, array: readonly number[]) => void, thisArg?: any) => void
43+
>[1, 2, 3].forEach : (callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any) => void
4444
>[1, 2, 3] : number[]
4545
>1 : 1
4646
>2 : 2
4747
>3 : 3
48-
>forEach : (callbackfn: (value: number, index: number, array: readonly number[]) => void, thisArg?: any) => void
48+
>forEach : (callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any) => void
4949
>function(j) { use(x); } : (j: number) => void
5050
>j : number
5151
>use(x) : any

tests/baselines/reference/argumentsAsPropertyName2.types

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ function foo() {
1818

1919
[].forEach(function () { i });
2020
>[].forEach(function () { i }) : void
21-
>[].forEach : (callbackfn: (value: any, index: number, array: readonly any[]) => void, thisArg?: any) => void
21+
>[].forEach : (callbackfn: (value: any, index: number, array: any[]) => void, thisArg?: any) => void
2222
>[] : undefined[]
23-
>forEach : (callbackfn: (value: any, index: number, array: readonly any[]) => void, thisArg?: any) => void
23+
>forEach : (callbackfn: (value: any, index: number, array: any[]) => void, thisArg?: any) => void
2424
>function () { i } : () => void
2525
>i : number
2626

tests/baselines/reference/arrayConcatMap.types

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
var x = [].concat([{ a: 1 }], [{ a: 2 }])
33
>x : any[]
44
>[].concat([{ a: 1 }], [{ a: 2 }]) .map(b => b.a) : any[]
5-
>[].concat([{ a: 1 }], [{ a: 2 }]) .map : <U>(callbackfn: (value: any, index: number, array: readonly any[]) => U, thisArg?: any) => U[]
5+
>[].concat([{ a: 1 }], [{ a: 2 }]) .map : <U>(callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[]
66
>[].concat([{ a: 1 }], [{ a: 2 }]) : any[]
77
>[].concat : { (...items: ConcatArray<any>[]): any[]; (...items: any[]): any[]; }
88
>[] : undefined[]
@@ -17,7 +17,7 @@ var x = [].concat([{ a: 1 }], [{ a: 2 }])
1717
>2 : 2
1818

1919
.map(b => b.a);
20-
>map : <U>(callbackfn: (value: any, index: number, array: readonly any[]) => U, thisArg?: any) => U[]
20+
>map : <U>(callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[]
2121
>b => b.a : (b: any) => any
2222
>b : any
2323
>b.a : any

tests/baselines/reference/arrayEvery.types

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ const isString = (x: unknown): x is string => typeof x === 'string';
1515

1616
if (foo.every(isString)) {
1717
>foo.every(isString) : boolean
18-
>foo.every : { <S extends string | number>(predicate: (value: string | number, index: number, array: readonly (string | number)[]) => value is S, thisArg?: any): this is readonly S[]; (predicate: (value: string | number, index: number, array: readonly (string | number)[]) => unknown, thisArg?: any): boolean; }
18+
>foo.every : { <S extends string | number>(predicate: (value: string | number, index: number, array: (string | number)[]) => value is S, thisArg?: any): this is readonly S[]; (predicate: (value: string | number, index: number, array: (string | number)[]) => unknown, thisArg?: any): boolean; }
1919
>foo : (string | number)[]
20-
>every : { <S extends string | number>(predicate: (value: string | number, index: number, array: readonly (string | number)[]) => value is S, thisArg?: any): this is readonly S[]; (predicate: (value: string | number, index: number, array: readonly (string | number)[]) => unknown, thisArg?: any): boolean; }
20+
>every : { <S extends string | number>(predicate: (value: string | number, index: number, array: (string | number)[]) => value is S, thisArg?: any): this is readonly S[]; (predicate: (value: string | number, index: number, array: (string | number)[]) => unknown, thisArg?: any): boolean; }
2121
>isString : (x: unknown) => x is string
2222

2323
foo[0].slice(0);

tests/baselines/reference/arrayFilter.types

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ var foo = [
2020

2121
]
2222

23-
foo.filter(x => x.name); //should accepted all possible types not only boolean!
23+
foo.filter(x => x.name); //should accepted all possible types not only boolean!
2424
>foo.filter(x => x.name) : { name: string; }[]
25-
>foo.filter : { <S extends { name: string; }>(predicate: (value: { name: string; }, index: number, array: readonly { name: string; }[]) => value is S, thisArg?: any): S[]; (predicate: (value: { name: string; }, index: number, array: readonly { name: string; }[]) => unknown, thisArg?: any): { name: string; }[]; }
25+
>foo.filter : { <S extends { name: string; }>(predicate: (value: { name: string; }, index: number, array: { name: string; }[]) => value is S, thisArg?: any): S[]; (predicate: (value: { name: string; }, index: number, array: { name: string; }[]) => unknown, thisArg?: any): { name: string; }[]; }
2626
>foo : { name: string; }[]
27-
>filter : { <S extends { name: string; }>(predicate: (value: { name: string; }, index: number, array: readonly { name: string; }[]) => value is S, thisArg?: any): S[]; (predicate: (value: { name: string; }, index: number, array: readonly { name: string; }[]) => unknown, thisArg?: any): { name: string; }[]; }
27+
>filter : { <S extends { name: string; }>(predicate: (value: { name: string; }, index: number, array: { name: string; }[]) => value is S, thisArg?: any): S[]; (predicate: (value: { name: string; }, index: number, array: { name: string; }[]) => unknown, thisArg?: any): { name: string; }[]; }
2828
>x => x.name : (x: { name: string; }) => string
2929
>x : { name: string; }
3030
>x.name : string

tests/baselines/reference/arrayFind.types

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ const arrayOfStringsNumbersAndBooleans = ["string", false, 0, "strung", 1, true]
2424
const foundNumber: number | undefined = arrayOfStringsNumbersAndBooleans.find(isNumber);
2525
>foundNumber : number
2626
>arrayOfStringsNumbersAndBooleans.find(isNumber) : number
27-
>arrayOfStringsNumbersAndBooleans.find : { <S extends string | number | boolean>(predicate: (this: void, value: string | number | boolean, index: number, obj: readonly (string | number | boolean)[]) => value is S, thisArg?: any): S; (predicate: (value: string | number | boolean, index: number, obj: readonly (string | number | boolean)[]) => unknown, thisArg?: any): string | number | boolean; }
27+
>arrayOfStringsNumbersAndBooleans.find : { <S extends string | number | boolean>(predicate: (this: void, value: string | number | boolean, index: number, obj: (string | number | boolean)[]) => value is S, thisArg?: any): S; (predicate: (value: string | number | boolean, index: number, obj: (string | number | boolean)[]) => unknown, thisArg?: any): string | number | boolean; }
2828
>arrayOfStringsNumbersAndBooleans : (string | number | boolean)[]
29-
>find : { <S extends string | number | boolean>(predicate: (this: void, value: string | number | boolean, index: number, obj: readonly (string | number | boolean)[]) => value is S, thisArg?: any): S; (predicate: (value: string | number | boolean, index: number, obj: readonly (string | number | boolean)[]) => unknown, thisArg?: any): string | number | boolean; }
29+
>find : { <S extends string | number | boolean>(predicate: (this: void, value: string | number | boolean, index: number, obj: (string | number | boolean)[]) => value is S, thisArg?: any): S; (predicate: (value: string | number | boolean, index: number, obj: (string | number | boolean)[]) => unknown, thisArg?: any): string | number | boolean; }
3030
>isNumber : (x: any) => x is number
3131

3232
const readonlyArrayOfStringsNumbersAndBooleans = arrayOfStringsNumbersAndBooleans as ReadonlyArray<string | number | boolean>;

tests/baselines/reference/autoLift2.types

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ class A
3737

3838
[1, 2].forEach((p) => this.foo);
3939
>[1, 2].forEach((p) => this.foo) : void
40-
>[1, 2].forEach : (callbackfn: (value: number, index: number, array: readonly number[]) => void, thisArg?: any) => void
40+
>[1, 2].forEach : (callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any) => void
4141
>[1, 2] : number[]
4242
>1 : 1
4343
>2 : 2
44-
>forEach : (callbackfn: (value: number, index: number, array: readonly number[]) => void, thisArg?: any) => void
44+
>forEach : (callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any) => void
4545
>(p) => this.foo : (p: number) => any
4646
>p : number
4747
>this.foo : any
@@ -50,11 +50,11 @@ class A
5050

5151
[1, 2].forEach((p) => this.bar);
5252
>[1, 2].forEach((p) => this.bar) : void
53-
>[1, 2].forEach : (callbackfn: (value: number, index: number, array: readonly number[]) => void, thisArg?: any) => void
53+
>[1, 2].forEach : (callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any) => void
5454
>[1, 2] : number[]
5555
>1 : 1
5656
>2 : 2
57-
>forEach : (callbackfn: (value: number, index: number, array: readonly number[]) => void, thisArg?: any) => void
57+
>forEach : (callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any) => void
5858
>(p) => this.bar : (p: number) => any
5959
>p : number
6060
>this.bar : any

tests/baselines/reference/bestChoiceType.types

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
(''.match(/ /) || []).map(s => s.toLowerCase());
55
>(''.match(/ /) || []).map(s => s.toLowerCase()) : string[]
6-
>(''.match(/ /) || []).map : <U>(callbackfn: (value: string, index: number, array: readonly string[]) => U, thisArg?: any) => U[]
6+
>(''.match(/ /) || []).map : <U>(callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any) => U[]
77
>(''.match(/ /) || []) : RegExpMatchArray
88
>''.match(/ /) || [] : RegExpMatchArray
99
>''.match(/ /) : RegExpMatchArray | null
@@ -12,7 +12,7 @@
1212
>match : (regexp: string | RegExp) => RegExpMatchArray | null
1313
>/ / : RegExp
1414
>[] : never[]
15-
>map : <U>(callbackfn: (value: string, index: number, array: readonly string[]) => U, thisArg?: any) => U[]
15+
>map : <U>(callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any) => U[]
1616
>s => s.toLowerCase() : (s: string) => string
1717
>s : string
1818
>s.toLowerCase() : string
@@ -42,9 +42,9 @@ function f1() {
4242
let z = y.map(s => s.toLowerCase());
4343
>z : string[]
4444
>y.map(s => s.toLowerCase()) : string[]
45-
>y.map : <U>(callbackfn: (value: string, index: number, array: readonly string[]) => U, thisArg?: any) => U[]
45+
>y.map : <U>(callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any) => U[]
4646
>y : RegExpMatchArray
47-
>map : <U>(callbackfn: (value: string, index: number, array: readonly string[]) => U, thisArg?: any) => U[]
47+
>map : <U>(callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any) => U[]
4848
>s => s.toLowerCase() : (s: string) => string
4949
>s : string
5050
>s.toLowerCase() : string
@@ -74,9 +74,9 @@ function f2() {
7474
let z = y.map(s => s.toLowerCase());
7575
>z : string[]
7676
>y.map(s => s.toLowerCase()) : string[]
77-
>y.map : <U>(callbackfn: (value: string, index: number, array: readonly string[]) => U, thisArg?: any) => U[]
77+
>y.map : <U>(callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any) => U[]
7878
>y : RegExpMatchArray
79-
>map : <U>(callbackfn: (value: string, index: number, array: readonly string[]) => U, thisArg?: any) => U[]
79+
>map : <U>(callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any) => U[]
8080
>s => s.toLowerCase() : (s: string) => string
8181
>s : string
8282
>s.toLowerCase() : string

tests/baselines/reference/bindingPatternInParameter01.types

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ const nestedArray = [[[1, 2]], [[3, 4]]];
1313

1414
nestedArray.forEach(([[a, b]]) => {
1515
>nestedArray.forEach(([[a, b]]) => { console.log(a, b);}) : void
16-
>nestedArray.forEach : (callbackfn: (value: number[][], index: number, array: readonly number[][][]) => void, thisArg?: any) => void
16+
>nestedArray.forEach : (callbackfn: (value: number[][], index: number, array: number[][][]) => void, thisArg?: any) => void
1717
>nestedArray : number[][][]
18-
>forEach : (callbackfn: (value: number[][], index: number, array: readonly number[][][]) => void, thisArg?: any) => void
18+
>forEach : (callbackfn: (value: number[][], index: number, array: number[][][]) => void, thisArg?: any) => void
1919
>([[a, b]]) => { console.log(a, b);} : ([[a, b]]: number[][]) => void
2020
>a : number
2121
>b : number

0 commit comments

Comments
 (0)