Skip to content

Commit ae532ed

Browse files
committed
Update tests
1 parent fca0377 commit ae532ed

File tree

214 files changed

+933
-963
lines changed

Some content is hidden

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

214 files changed

+933
-963
lines changed

tests/baselines/reference/arityAndOrderCompatibility01.errors.txt

+12-8
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@ arityAndOrderCompatibility01.ts(23,5): error TS2322: Type '{ 0: string; 1: numbe
1111
arityAndOrderCompatibility01.ts(24,5): error TS2322: Type '[string, number]' is not assignable to type '[number]'.
1212
Source has 2 element(s) but target allows only 1.
1313
arityAndOrderCompatibility01.ts(25,5): error TS2322: Type 'StrNum' is not assignable to type '[number]'.
14-
Types of property '0' are incompatible.
15-
Type 'string' is not assignable to type 'number'.
14+
The types returned by 'pop()' are incompatible between these types.
15+
Type 'string | number' is not assignable to type 'number'.
16+
Type 'string' is not assignable to type 'number'.
1617
arityAndOrderCompatibility01.ts(26,5): error TS2322: Type '{ 0: string; 1: number; length: 2; }' is not assignable to type '[number]'.
1718
arityAndOrderCompatibility01.ts(27,5): error TS2322: Type '[string, number]' is not assignable to type '[string]'.
1819
Source has 2 element(s) but target allows only 1.
1920
arityAndOrderCompatibility01.ts(28,5): error TS2322: Type 'StrNum' is not assignable to type '[string]'.
20-
Types of property 'length' are incompatible.
21-
Type '2' is not assignable to type '1'.
21+
The types returned by 'pop()' are incompatible between these types.
22+
Type 'string | number' is not assignable to type 'string'.
23+
Type 'number' is not assignable to type 'string'.
2224
arityAndOrderCompatibility01.ts(29,5): error TS2322: Type '{ 0: string; 1: number; length: 2; }' is not assignable to type '[string]'.
2325
arityAndOrderCompatibility01.ts(30,5): error TS2322: Type '[string, number]' is not assignable to type '[number, string]'.
2426
Type at position 0 in source is not compatible with type at position 0 in target.
@@ -78,8 +80,9 @@ arityAndOrderCompatibility01.ts(32,5): error TS2322: Type '{ 0: string; 1: numbe
7880
var l2: [number] = y;
7981
~~
8082
!!! error TS2322: Type 'StrNum' is not assignable to type '[number]'.
81-
!!! error TS2322: Types of property '0' are incompatible.
82-
!!! error TS2322: Type 'string' is not assignable to type 'number'.
83+
!!! error TS2322: The types returned by 'pop()' are incompatible between these types.
84+
!!! error TS2322: Type 'string | number' is not assignable to type 'number'.
85+
!!! error TS2322: Type 'string' is not assignable to type 'number'.
8386
var l3: [number] = z;
8487
~~
8588
!!! error TS2322: Type '{ 0: string; 1: number; length: 2; }' is not assignable to type '[number]'.
@@ -90,8 +93,9 @@ arityAndOrderCompatibility01.ts(32,5): error TS2322: Type '{ 0: string; 1: numbe
9093
var m2: [string] = y;
9194
~~
9295
!!! error TS2322: Type 'StrNum' is not assignable to type '[string]'.
93-
!!! error TS2322: Types of property 'length' are incompatible.
94-
!!! error TS2322: Type '2' is not assignable to type '1'.
96+
!!! error TS2322: The types returned by 'pop()' are incompatible between these types.
97+
!!! error TS2322: Type 'string | number' is not assignable to type 'string'.
98+
!!! error TS2322: Type 'number' is not assignable to type 'string'.
9599
var m3: [string] = z;
96100
~~
97101
!!! error TS2322: Type '{ 0: string; 1: number; length: 2; }' is not assignable to type '[string]'.

tests/baselines/reference/arrayAssignmentTest1.errors.txt

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
arrayAssignmentTest1.ts(46,5): error TS2741: Property 'IM1' is missing in type 'undefined[]' but required in type 'I1'.
22
arrayAssignmentTest1.ts(47,5): error TS2739: Type 'undefined[]' is missing the following properties from type 'C1': IM1, C1M1
3-
arrayAssignmentTest1.ts(48,5): error TS2739: Type 'undefined[]' is missing the following properties from type 'C2': C2M1, IM1, C1M1
3+
arrayAssignmentTest1.ts(48,5): error TS2739: Type 'undefined[]' is missing the following properties from type 'C2': IM1, C1M1, C2M1
44
arrayAssignmentTest1.ts(49,5): error TS2741: Property 'CM3M1' is missing in type 'undefined[]' but required in type 'C3'.
55
arrayAssignmentTest1.ts(60,1): error TS2322: Type 'C3[]' is not assignable to type 'I1[]'.
66
Property 'IM1' is missing in type 'C3' but required in type 'I1'.
@@ -11,9 +11,9 @@ arrayAssignmentTest1.ts(65,1): error TS2322: Type 'C3[]' is not assignable to ty
1111
arrayAssignmentTest1.ts(68,1): error TS2322: Type 'C1[]' is not assignable to type 'C2[]'.
1212
Property 'C2M1' is missing in type 'C1' but required in type 'C2'.
1313
arrayAssignmentTest1.ts(69,1): error TS2322: Type 'I1[]' is not assignable to type 'C2[]'.
14-
Type 'I1' is missing the following properties from type 'C2': C2M1, C1M1
14+
Type 'I1' is missing the following properties from type 'C2': C1M1, C2M1
1515
arrayAssignmentTest1.ts(70,1): error TS2322: Type 'C3[]' is not assignable to type 'C2[]'.
16-
Type 'C3' is missing the following properties from type 'C2': C2M1, IM1, C1M1
16+
Type 'C3' is missing the following properties from type 'C2': IM1, C1M1, C2M1
1717
arrayAssignmentTest1.ts(75,1): error TS2322: Type 'C2[]' is not assignable to type 'C3[]'.
1818
Property 'CM3M1' is missing in type 'C2' but required in type 'C3'.
1919
arrayAssignmentTest1.ts(76,1): error TS2322: Type 'C1[]' is not assignable to type 'C3[]'.
@@ -83,7 +83,7 @@ arrayAssignmentTest1.ts(85,1): error TS2740: Type 'I1' is missing the following
8383
!!! error TS2739: Type 'undefined[]' is missing the following properties from type 'C1': IM1, C1M1
8484
var c2_error: C2 = []; // should be an error - is
8585
~~~~~~~~
86-
!!! error TS2739: Type 'undefined[]' is missing the following properties from type 'C2': C2M1, IM1, C1M1
86+
!!! error TS2739: Type 'undefined[]' is missing the following properties from type 'C2': IM1, C1M1, C2M1
8787
var c3_error: C3 = []; // should be an error - is
8888
~~~~~~~~
8989
!!! error TS2741: Property 'CM3M1' is missing in type 'undefined[]' but required in type 'C3'.
@@ -125,11 +125,11 @@ arrayAssignmentTest1.ts(85,1): error TS2740: Type 'I1' is missing the following
125125
arr_c2 = arr_i1; // should be an error - subtype relationship - is
126126
~~~~~~
127127
!!! error TS2322: Type 'I1[]' is not assignable to type 'C2[]'.
128-
!!! error TS2322: Type 'I1' is missing the following properties from type 'C2': C2M1, C1M1
128+
!!! error TS2322: Type 'I1' is missing the following properties from type 'C2': C1M1, C2M1
129129
arr_c2 = arr_c3; // should be an error - is
130130
~~~~~~
131131
!!! error TS2322: Type 'C3[]' is not assignable to type 'C2[]'.
132-
!!! error TS2322: Type 'C3' is missing the following properties from type 'C2': C2M1, IM1, C1M1
132+
!!! error TS2322: Type 'C3' is missing the following properties from type 'C2': IM1, C1M1, C2M1
133133

134134
// "clean up bug" occurs at this point
135135
// if you move these three expressions to another file, they raise an error

tests/baselines/reference/arrowFunctionExpressions.types

+2-2
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,9 @@ var p9 = ({ a: { b = 1 } = { b: 1 } }) => { };
175175
> : ^
176176

177177
var p10 = ([{ value, done }]) => { };
178-
>p10 : ([{ value, done }]: [{ value: any; done: any; }]) => void
178+
>p10 : ([{ value, done }]: [{ done: any; value: any; }]) => void
179179
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
180-
>([{ value, done }]) => { } : ([{ value, done }]: [{ value: any; done: any; }]) => void
180+
>([{ value, done }]) => { } : ([{ value, done }]: [{ done: any; value: any; }]) => void
181181
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
182182
>value : any
183183
> : ^^^

tests/baselines/reference/assignmentCompatWithCallSignatures3.errors.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ assignmentCompatWithCallSignatures3.ts(80,1): error TS2322: Type '(x: Base[], y:
4646
Types of parameters 'y' and 'y' are incompatible.
4747
Type 'T' is not assignable to type 'Derived2[]'.
4848
Type 'Base[]' is not assignable to type 'Derived2[]'.
49-
Type 'Base' is missing the following properties from type 'Derived2': baz, bar
49+
Type 'Base' is missing the following properties from type 'Derived2': bar, baz
5050
assignmentCompatWithCallSignatures3.ts(83,1): error TS2322: Type '(x: Base[], y: Derived[]) => Derived[]' is not assignable to type '<T extends Array<Derived>>(x: Base[], y: T) => T'.
5151
Type 'Derived[]' is not assignable to type 'T'.
5252
'Derived[]' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Derived[]'.
@@ -208,7 +208,7 @@ assignmentCompatWithCallSignatures3.ts(86,1): error TS2322: Type '(x: { a: strin
208208
!!! error TS2322: Types of parameters 'y' and 'y' are incompatible.
209209
!!! error TS2322: Type 'T' is not assignable to type 'Derived2[]'.
210210
!!! error TS2322: Type 'Base[]' is not assignable to type 'Derived2[]'.
211-
!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': baz, bar
211+
!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': bar, baz
212212
var b13: <T extends Array<Derived>>(x: Array<Base>, y: T) => T;
213213
a13 = b13; // ok
214214
b13 = a13; // ok

tests/baselines/reference/assignmentCompatWithConstructSignatures3.errors.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ assignmentCompatWithConstructSignatures3.ts(80,1): error TS2322: Type 'new (x: B
4646
Types of parameters 'y' and 'y' are incompatible.
4747
Type 'T' is not assignable to type 'Derived2[]'.
4848
Type 'Base[]' is not assignable to type 'Derived2[]'.
49-
Type 'Base' is missing the following properties from type 'Derived2': baz, bar
49+
Type 'Base' is missing the following properties from type 'Derived2': bar, baz
5050
assignmentCompatWithConstructSignatures3.ts(83,1): error TS2322: Type 'new (x: Base[], y: Derived[]) => Derived[]' is not assignable to type 'new <T extends Array<Derived>>(x: Base[], y: T) => T'.
5151
Type 'Derived[]' is not assignable to type 'T'.
5252
'Derived[]' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Derived[]'.
@@ -208,7 +208,7 @@ assignmentCompatWithConstructSignatures3.ts(86,1): error TS2322: Type 'new (x: {
208208
!!! error TS2322: Types of parameters 'y' and 'y' are incompatible.
209209
!!! error TS2322: Type 'T' is not assignable to type 'Derived2[]'.
210210
!!! error TS2322: Type 'Base[]' is not assignable to type 'Derived2[]'.
211-
!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': baz, bar
211+
!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': bar, baz
212212
var b13: new <T extends Array<Derived>>(x: Array<Base>, y: T) => T;
213213
a13 = b13; // ok
214214
b13 = a13; // ok

tests/baselines/reference/assignmentCompatWithNumericIndexer.errors.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ assignmentCompatWithNumericIndexer.ts(14,1): error TS2322: Type 'A' is not assig
33
Property 'bar' is missing in type 'Base' but required in type 'Derived'.
44
assignmentCompatWithNumericIndexer.ts(18,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'.
55
'number' index signatures are incompatible.
6-
Type 'Base' is missing the following properties from type 'Derived2': baz, bar
6+
Type 'Base' is missing the following properties from type 'Derived2': bar, baz
77
assignmentCompatWithNumericIndexer.ts(32,9): error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A<T>'.
88
'number' index signatures are incompatible.
99
Type 'Derived' is not assignable to type 'T'.
@@ -19,7 +19,7 @@ assignmentCompatWithNumericIndexer.ts(36,9): error TS2322: Type '{ [x: number]:
1919
assignmentCompatWithNumericIndexer.ts(37,9): error TS2322: Type 'A<T>' is not assignable to type '{ [x: number]: Derived2; }'.
2020
'number' index signatures are incompatible.
2121
Type 'T' is not assignable to type 'Derived2'.
22-
Type 'Base' is missing the following properties from type 'Derived2': baz, bar
22+
Type 'Base' is missing the following properties from type 'Derived2': bar, baz
2323

2424

2525
==== assignmentCompatWithNumericIndexer.ts (6 errors) ====
@@ -49,7 +49,7 @@ assignmentCompatWithNumericIndexer.ts(37,9): error TS2322: Type 'A<T>' is not as
4949
~~
5050
!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'.
5151
!!! error TS2322: 'number' index signatures are incompatible.
52-
!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': baz, bar
52+
!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': bar, baz
5353

5454
module Generics {
5555
class A<T extends Base> {
@@ -89,7 +89,7 @@ assignmentCompatWithNumericIndexer.ts(37,9): error TS2322: Type 'A<T>' is not as
8989
!!! error TS2322: Type 'A<T>' is not assignable to type '{ [x: number]: Derived2; }'.
9090
!!! error TS2322: 'number' index signatures are incompatible.
9191
!!! error TS2322: Type 'T' is not assignable to type 'Derived2'.
92-
!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': baz, bar
92+
!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': bar, baz
9393

9494
var b3: { [x: number]: T; }
9595
a = b3; // ok

tests/baselines/reference/assignmentCompatWithNumericIndexer2.errors.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ assignmentCompatWithNumericIndexer2.ts(14,1): error TS2322: Type 'A' is not assi
33
Property 'bar' is missing in type 'Base' but required in type 'Derived'.
44
assignmentCompatWithNumericIndexer2.ts(18,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'.
55
'number' index signatures are incompatible.
6-
Type 'Base' is missing the following properties from type 'Derived2': baz, bar
6+
Type 'Base' is missing the following properties from type 'Derived2': bar, baz
77
assignmentCompatWithNumericIndexer2.ts(32,9): error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A<T>'.
88
'number' index signatures are incompatible.
99
Type 'Derived' is not assignable to type 'T'.
@@ -19,7 +19,7 @@ assignmentCompatWithNumericIndexer2.ts(36,9): error TS2322: Type '{ [x: number]:
1919
assignmentCompatWithNumericIndexer2.ts(37,9): error TS2322: Type 'A<T>' is not assignable to type '{ [x: number]: Derived2; }'.
2020
'number' index signatures are incompatible.
2121
Type 'T' is not assignable to type 'Derived2'.
22-
Type 'Base' is missing the following properties from type 'Derived2': baz, bar
22+
Type 'Base' is missing the following properties from type 'Derived2': bar, baz
2323

2424

2525
==== assignmentCompatWithNumericIndexer2.ts (6 errors) ====
@@ -49,7 +49,7 @@ assignmentCompatWithNumericIndexer2.ts(37,9): error TS2322: Type 'A<T>' is not a
4949
~~
5050
!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'.
5151
!!! error TS2322: 'number' index signatures are incompatible.
52-
!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': baz, bar
52+
!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': bar, baz
5353

5454
module Generics {
5555
interface A<T extends Base> {
@@ -89,7 +89,7 @@ assignmentCompatWithNumericIndexer2.ts(37,9): error TS2322: Type 'A<T>' is not a
8989
!!! error TS2322: Type 'A<T>' is not assignable to type '{ [x: number]: Derived2; }'.
9090
!!! error TS2322: 'number' index signatures are incompatible.
9191
!!! error TS2322: Type 'T' is not assignable to type 'Derived2'.
92-
!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': baz, bar
92+
!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': bar, baz
9393

9494
var b3: { [x: number]: T; }
9595
a = b3; // ok

tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ assignmentCompatWithStringIndexer.ts(15,1): error TS2322: Type 'A' is not assign
33
Property 'bar' is missing in type 'Base' but required in type 'Derived'.
44
assignmentCompatWithStringIndexer.ts(19,1): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'.
55
'string' index signatures are incompatible.
6-
Type 'Base' is missing the following properties from type 'Derived2': baz, bar
6+
Type 'Base' is missing the following properties from type 'Derived2': bar, baz
77
assignmentCompatWithStringIndexer.ts(33,5): error TS2322: Type 'A<Base>' is not assignable to type '{ [x: string]: Derived; }'.
88
'string' index signatures are incompatible.
99
Property 'bar' is missing in type 'Base' but required in type 'Derived'.
1010
assignmentCompatWithStringIndexer.ts(41,5): error TS2322: Type 'A<Base>' is not assignable to type '{ [x: string]: Derived2; }'.
1111
'string' index signatures are incompatible.
12-
Type 'Base' is missing the following properties from type 'Derived2': baz, bar
12+
Type 'Base' is missing the following properties from type 'Derived2': bar, baz
1313
assignmentCompatWithStringIndexer.ts(46,9): error TS2322: Type '{ [x: string]: Derived; }' is not assignable to type 'A<T>'.
1414
'string' index signatures are incompatible.
1515
Type 'Derived' is not assignable to type 'T'.
@@ -25,7 +25,7 @@ assignmentCompatWithStringIndexer.ts(50,9): error TS2322: Type '{ [x: string]: D
2525
assignmentCompatWithStringIndexer.ts(51,9): error TS2322: Type 'A<T>' is not assignable to type '{ [x: string]: Derived2; }'.
2626
'string' index signatures are incompatible.
2727
Type 'T' is not assignable to type 'Derived2'.
28-
Type 'Base' is missing the following properties from type 'Derived2': baz, bar
28+
Type 'Base' is missing the following properties from type 'Derived2': bar, baz
2929

3030

3131
==== assignmentCompatWithStringIndexer.ts (8 errors) ====
@@ -56,7 +56,7 @@ assignmentCompatWithStringIndexer.ts(51,9): error TS2322: Type 'A<T>' is not ass
5656
~~
5757
!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'.
5858
!!! error TS2322: 'string' index signatures are incompatible.
59-
!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': baz, bar
59+
!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': bar, baz
6060

6161
module Generics {
6262
class A<T extends Base> {
@@ -87,7 +87,7 @@ assignmentCompatWithStringIndexer.ts(51,9): error TS2322: Type 'A<T>' is not ass
8787
~~
8888
!!! error TS2322: Type 'A<Base>' is not assignable to type '{ [x: string]: Derived2; }'.
8989
!!! error TS2322: 'string' index signatures are incompatible.
90-
!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': baz, bar
90+
!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': bar, baz
9191

9292
function foo<T extends Base>() {
9393
var b3: { [x: string]: Derived; };
@@ -118,6 +118,6 @@ assignmentCompatWithStringIndexer.ts(51,9): error TS2322: Type 'A<T>' is not ass
118118
!!! error TS2322: Type 'A<T>' is not assignable to type '{ [x: string]: Derived2; }'.
119119
!!! error TS2322: 'string' index signatures are incompatible.
120120
!!! error TS2322: Type 'T' is not assignable to type 'Derived2'.
121-
!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': baz, bar
121+
!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': bar, baz
122122
}
123123
}

0 commit comments

Comments
 (0)