Skip to content

Commit 888da3c

Browse files
committed
Update baselines
1 parent ea55de3 commit 888da3c

10 files changed

+74
-37
lines changed

tests/baselines/reference/arityAndOrderCompatibility01.errors.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(32,5): error
4040

4141

4242
==== tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts (19 errors) ====
43-
interface StrNum extends Array<string|number> {
43+
interface StrNum extends TupleBase<string|number> {
4444
0: string;
4545
1: number;
4646
length: 2;

tests/baselines/reference/arityAndOrderCompatibility01.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//// [arityAndOrderCompatibility01.ts]
2-
interface StrNum extends Array<string|number> {
2+
interface StrNum extends TupleBase<string|number> {
33
0: string;
44
1: number;
55
length: 2;

tests/baselines/reference/arityAndOrderCompatibility01.symbols

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
=== tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts ===
2-
interface StrNum extends Array<string|number> {
2+
interface StrNum extends TupleBase<string|number> {
33
>StrNum : Symbol(StrNum, Decl(arityAndOrderCompatibility01.ts, 0, 0))
4-
>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
4+
>TupleBase : Symbol(TupleBase, Decl(lib.d.ts, --, --))
55

66
0: string;
77
1: number;

tests/baselines/reference/arityAndOrderCompatibility01.types

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
=== tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts ===
2-
interface StrNum extends Array<string|number> {
2+
interface StrNum extends TupleBase<string|number> {
33
>StrNum : StrNum
4-
>Array : T[]
4+
>TupleBase : TupleBase<T>
55

66
0: string;
77
1: number;

tests/baselines/reference/assignmentCompatBetweenTupleAndArray.errors.txt

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatBetweenTupleAndArray.ts(17,1): error TS2322: Type '[number, string]' is not assignable to type 'number[]'.
2-
Types of property 'pop' are incompatible.
3-
Type '() => string | number' is not assignable to type '() => number'.
4-
Type 'string | number' is not assignable to type 'number'.
5-
Type 'string' is not assignable to type 'number'.
2+
Types of property 'concat' are incompatible.
3+
Type '{ (...items: ReadonlyArray<string | number>[]): (string | number)[]; (...items: (string | number | ReadonlyArray<string | number>)[]): (string | number)[]; }' is not assignable to type '{ (...items: ReadonlyArray<number>[]): number[]; (...items: (number | ReadonlyArray<number>)[]): number[]; }'.
4+
Type '(string | number)[]' is not assignable to type 'number[]'.
5+
Type 'string | number' is not assignable to type 'number'.
6+
Type 'string' is not assignable to type 'number'.
67
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatBetweenTupleAndArray.ts(18,1): error TS2322: Type '{}[]' is not assignable to type '[{}]'.
78
Property '0' is missing in type '{}[]'.
89

@@ -27,10 +28,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
2728
numArray = numStrTuple;
2829
~~~~~~~~
2930
!!! error TS2322: Type '[number, string]' is not assignable to type 'number[]'.
30-
!!! error TS2322: Types of property 'pop' are incompatible.
31-
!!! error TS2322: Type '() => string | number' is not assignable to type '() => number'.
32-
!!! error TS2322: Type 'string | number' is not assignable to type 'number'.
33-
!!! error TS2322: Type 'string' is not assignable to type 'number'.
31+
!!! error TS2322: Types of property 'concat' are incompatible.
32+
!!! error TS2322: Type '{ (...items: ReadonlyArray<string | number>[]): (string | number)[]; (...items: (string | number | ReadonlyArray<string | number>)[]): (string | number)[]; }' is not assignable to type '{ (...items: ReadonlyArray<number>[]): number[]; (...items: (number | ReadonlyArray<number>)[]): number[]; }'.
33+
!!! error TS2322: Type '(string | number)[]' is not assignable to type 'number[]'.
34+
!!! error TS2322: Type 'string | number' is not assignable to type 'number'.
35+
!!! error TS2322: Type 'string' is not assignable to type 'number'.
3436
emptyObjTuple = emptyObjArray;
3537
~~~~~~~~~~~~~
3638
!!! error TS2322: Type '{}[]' is not assignable to type '[{}]'.

tests/baselines/reference/tupleTypes.errors.txt

+20-16
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,17 @@ tests/cases/compiler/tupleTypes.ts(18,1): error TS2322: Type '[number, string, n
1010
Type '3' is not assignable to type '2'.
1111
tests/cases/compiler/tupleTypes.ts(41,1): error TS2322: Type 'undefined[]' is not assignable to type '[number, string]'.
1212
tests/cases/compiler/tupleTypes.ts(47,1): error TS2322: Type '[number, string]' is not assignable to type 'number[]'.
13-
Types of property 'pop' are incompatible.
14-
Type '() => string | number' is not assignable to type '() => number'.
15-
Type 'string | number' is not assignable to type 'number'.
16-
Type 'string' is not assignable to type 'number'.
13+
Types of property 'concat' are incompatible.
14+
Type '{ (...items: ReadonlyArray<string | number>[]): (string | number)[]; (...items: (string | number | ReadonlyArray<string | number>)[]): (string | number)[]; }' is not assignable to type '{ (...items: ReadonlyArray<number>[]): number[]; (...items: (number | ReadonlyArray<number>)[]): number[]; }'.
15+
Type '(string | number)[]' is not assignable to type 'number[]'.
16+
Type 'string | number' is not assignable to type 'number'.
17+
Type 'string' is not assignable to type 'number'.
1718
tests/cases/compiler/tupleTypes.ts(49,1): error TS2322: Type '[number, {}]' is not assignable to type 'number[]'.
18-
Types of property 'pop' are incompatible.
19-
Type '() => number | {}' is not assignable to type '() => number'.
20-
Type 'number | {}' is not assignable to type 'number'.
21-
Type '{}' is not assignable to type 'number'.
19+
Types of property 'concat' are incompatible.
20+
Type '{ (...items: ReadonlyArray<number | {}>[]): (number | {})[]; (...items: (number | {} | ReadonlyArray<number | {}>)[]): (number | {})[]; }' is not assignable to type '{ (...items: ReadonlyArray<number>[]): number[]; (...items: (number | ReadonlyArray<number>)[]): number[]; }'.
21+
Type '(number | {})[]' is not assignable to type 'number[]'.
22+
Type 'number | {}' is not assignable to type 'number'.
23+
Type '{}' is not assignable to type 'number'.
2224
tests/cases/compiler/tupleTypes.ts(50,1): error TS2322: Type '[number, number]' is not assignable to type '[number, string]'.
2325
Type 'number' is not assignable to type 'string'.
2426
tests/cases/compiler/tupleTypes.ts(51,1): error TS2322: Type '[number, {}]' is not assignable to type '[number, string]'.
@@ -92,18 +94,20 @@ tests/cases/compiler/tupleTypes.ts(51,1): error TS2322: Type '[number, {}]' is n
9294
a = a1; // Error
9395
~
9496
!!! error TS2322: Type '[number, string]' is not assignable to type 'number[]'.
95-
!!! error TS2322: Types of property 'pop' are incompatible.
96-
!!! error TS2322: Type '() => string | number' is not assignable to type '() => number'.
97-
!!! error TS2322: Type 'string | number' is not assignable to type 'number'.
98-
!!! error TS2322: Type 'string' is not assignable to type 'number'.
97+
!!! error TS2322: Types of property 'concat' are incompatible.
98+
!!! error TS2322: Type '{ (...items: ReadonlyArray<string | number>[]): (string | number)[]; (...items: (string | number | ReadonlyArray<string | number>)[]): (string | number)[]; }' is not assignable to type '{ (...items: ReadonlyArray<number>[]): number[]; (...items: (number | ReadonlyArray<number>)[]): number[]; }'.
99+
!!! error TS2322: Type '(string | number)[]' is not assignable to type 'number[]'.
100+
!!! error TS2322: Type 'string | number' is not assignable to type 'number'.
101+
!!! error TS2322: Type 'string' is not assignable to type 'number'.
99102
a = a2;
100103
a = a3; // Error
101104
~
102105
!!! error TS2322: Type '[number, {}]' is not assignable to type 'number[]'.
103-
!!! error TS2322: Types of property 'pop' are incompatible.
104-
!!! error TS2322: Type '() => number | {}' is not assignable to type '() => number'.
105-
!!! error TS2322: Type 'number | {}' is not assignable to type 'number'.
106-
!!! error TS2322: Type '{}' is not assignable to type 'number'.
106+
!!! error TS2322: Types of property 'concat' are incompatible.
107+
!!! error TS2322: Type '{ (...items: ReadonlyArray<number | {}>[]): (number | {})[]; (...items: (number | {} | ReadonlyArray<number | {}>)[]): (number | {})[]; }' is not assignable to type '{ (...items: ReadonlyArray<number>[]): number[]; (...items: (number | ReadonlyArray<number>)[]): number[]; }'.
108+
!!! error TS2322: Type '(number | {})[]' is not assignable to type 'number[]'.
109+
!!! error TS2322: Type 'number | {}' is not assignable to type 'number'.
110+
!!! error TS2322: Type '{}' is not assignable to type 'number'.
107111
a1 = a2; // Error
108112
~~
109113
!!! error TS2322: Type '[number, number]' is not assignable to type '[number, string]'.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
tests/cases/conformance/types/tuple/typeInferenceWithTupleType.ts(16,9): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'never' has no compatible call signatures.
2+
3+
4+
==== tests/cases/conformance/types/tuple/typeInferenceWithTupleType.ts (1 errors) ====
5+
function combine<T, U>(x: T, y: U): [T, U] {
6+
return [x, y];
7+
}
8+
9+
var combineResult = combine("string", 10);
10+
var combineEle1 = combineResult[0]; // string
11+
var combineEle2 = combineResult[1]; // number
12+
13+
function zip<T, U>(array1: T[], array2: U[]): [[T, U]] {
14+
if (array1.length != array2.length) {
15+
return [[undefined, undefined]];
16+
}
17+
var length = array1.length;
18+
var zipResult: [[T, U]];
19+
for (var i = 0; i < length; ++i) {
20+
zipResult.push([array1[i], array2[i]]);
21+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22+
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'never' has no compatible call signatures.
23+
}
24+
return zipResult;
25+
}
26+
27+
var zipResult = zip(["foo", "bar"], [5, 6]);
28+
var zipResultEle = zipResult[0]; // [string, number]
29+
var zipResultEleEle = zipResult[0][0]; // string
30+
31+

tests/baselines/reference/typeInferenceWithTupleType.symbols

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ function zip<T, U>(array1: T[], array2: U[]): [[T, U]] {
7070
>i : Symbol(i, Decl(typeInferenceWithTupleType.ts, 14, 12))
7171

7272
zipResult.push([array1[i], array2[i]]);
73-
>zipResult.push : Symbol(Array.push, Decl(lib.d.ts, --, --))
73+
>zipResult.push : Symbol(TupleBase.push, Decl(lib.d.ts, --, --))
7474
>zipResult : Symbol(zipResult, Decl(typeInferenceWithTupleType.ts, 13, 7))
75-
>push : Symbol(Array.push, Decl(lib.d.ts, --, --))
75+
>push : Symbol(TupleBase.push, Decl(lib.d.ts, --, --))
7676
>array1 : Symbol(array1, Decl(typeInferenceWithTupleType.ts, 8, 19))
7777
>i : Symbol(i, Decl(typeInferenceWithTupleType.ts, 14, 12))
7878
>array2 : Symbol(array2, Decl(typeInferenceWithTupleType.ts, 8, 31))

tests/baselines/reference/typeInferenceWithTupleType.types

+4-4
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ function zip<T, U>(array1: T[], array2: U[]): [[T, U]] {
8282
>i : number
8383

8484
zipResult.push([array1[i], array2[i]]);
85-
>zipResult.push([array1[i], array2[i]]) : number
86-
>zipResult.push : (...items: [T, U][]) => number
85+
>zipResult.push([array1[i], array2[i]]) : any
86+
>zipResult.push : never
8787
>zipResult : [[T, U]]
88-
>push : (...items: [T, U][]) => number
89-
>[array1[i], array2[i]] : [T, U]
88+
>push : never
89+
>[array1[i], array2[i]] : (T | U)[]
9090
>array1[i] : T
9191
>array1 : T[]
9292
>i : number

tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
interface StrNum extends Array<string|number> {
1+
interface StrNum extends TupleBase<string|number> {
22
0: string;
33
1: number;
44
length: 2;

0 commit comments

Comments
 (0)