Skip to content

Commit da2efa0

Browse files
committed
Accept new baselines
1 parent ff3b627 commit da2efa0

File tree

36 files changed

+144
-96
lines changed

36 files changed

+144
-96
lines changed

tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.types

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function f<T>(x: T): T { return null; }
1111

1212
var r = f(1);
1313
>r : number
14-
>f(1) : number
14+
>f(1) : 1
1515
>f : <T>(x: T) => T
1616
>1 : 1
1717

@@ -26,7 +26,7 @@ var f2 = <T>(x: T): T => { return null; }
2626

2727
var r2 = f2(1);
2828
>r2 : number
29-
>f2(1) : number
29+
>f2(1) : 1
3030
>f2 : <T>(x: T) => T
3131
>1 : 1
3232

@@ -39,7 +39,7 @@ var f3: { <T>(x: T): T; }
3939

4040
var r3 = f3(1);
4141
>r3 : number
42-
>f3(1) : number
42+
>f3(1) : 1
4343
>f3 : <T>(x: T) => T
4444
>1 : 1
4545

@@ -59,7 +59,7 @@ class C {
5959
}
6060
var r4 = (new C()).f(1);
6161
>r4 : number
62-
>(new C()).f(1) : number
62+
>(new C()).f(1) : 1
6363
>(new C()).f : <T>(x: T) => T
6464
>(new C()) : C
6565
>new C() : C
@@ -83,7 +83,7 @@ var i: I;
8383

8484
var r5 = i.f(1);
8585
>r5 : number
86-
>i.f(1) : number
86+
>i.f(1) : 1
8787
>i.f : <T>(x: T) => T
8888
>i : I
8989
>f : <T>(x: T) => T

tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function foo4<T>(x: T) {
5454
}
5555
var r4 = foo4(1);
5656
>r4 : number
57-
>foo4(1) : number
57+
>foo4(1) : 1
5858
>foo4 : <T>(x: T) => T
5959
>1 : 1
6060

tests/baselines/reference/defaultBestCommonTypesHaveDecls.errors.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts(2,6): error TS2339: Property 'length' does not exist on type '{}'.
22
tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts(5,6): error TS2339: Property 'length' does not exist on type 'Object'.
33
tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts(8,14): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
4-
Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'.
4+
Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate '""'.
55

66

77
==== tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts (3 errors) ====
@@ -19,7 +19,7 @@ tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts(8,14): error TS2453: The
1919
var result = concat(1, ""); // error
2020
~~~~~~
2121
!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
22-
!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'.
22+
!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate '""'.
2323
var elementCount = result.length;
2424

2525
function concat2<T, U>(x: T, y: U) { return null; }

tests/baselines/reference/exportDefaultAsyncFunction2.types

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default async(() => await(Promise.resolve(1)));
2020
>() => await(Promise.resolve(1)) : () => any
2121
>await(Promise.resolve(1)) : any
2222
>await : (...args: any[]) => any
23-
>Promise.resolve(1) : Promise<1>
23+
>Promise.resolve(1) : Promise<number>
2424
>Promise.resolve : { <T>(value: T | PromiseLike<T>): Promise<T>; (): Promise<void>; }
2525
>Promise : PromiseConstructor
2626
>resolve : { <T>(value: T | PromiseLike<T>): Promise<T>; (): Promise<void>; }

tests/baselines/reference/extendBooleanInterface.types

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var a: string = x.doStuff();
2626

2727
var b: string = x.doOtherStuff('hm');
2828
>b : string
29-
>x.doOtherStuff('hm') : string
29+
>x.doOtherStuff('hm') : "hm"
3030
>x.doOtherStuff : <T>(x: T) => T
3131
>x : true
3232
>doOtherStuff : <T>(x: T) => T
@@ -41,7 +41,7 @@ var c: string = x['doStuff']();
4141

4242
var d: string = x['doOtherStuff']('hm');
4343
>d : string
44-
>x['doOtherStuff']('hm') : string
44+
>x['doOtherStuff']('hm') : "hm"
4545
>x['doOtherStuff'] : <T>(x: T) => T
4646
>x : true
4747
>'doOtherStuff' : "doOtherStuff"

tests/baselines/reference/extendNumberInterface.types

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var a: string = x.doStuff();
2626

2727
var b: string = x.doOtherStuff('hm');
2828
>b : string
29-
>x.doOtherStuff('hm') : string
29+
>x.doOtherStuff('hm') : "hm"
3030
>x.doOtherStuff : <T>(x: T) => T
3131
>x : number
3232
>doOtherStuff : <T>(x: T) => T
@@ -41,7 +41,7 @@ var c: string = x['doStuff']();
4141

4242
var d: string = x['doOtherStuff']('hm');
4343
>d : string
44-
>x['doOtherStuff']('hm') : string
44+
>x['doOtherStuff']('hm') : "hm"
4545
>x['doOtherStuff'] : <T>(x: T) => T
4646
>x : number
4747
>'doOtherStuff' : "doOtherStuff"

tests/baselines/reference/extendStringInterface.types

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var a: string = x.doStuff();
2626

2727
var b: string = x.doOtherStuff('hm');
2828
>b : string
29-
>x.doOtherStuff('hm') : string
29+
>x.doOtherStuff('hm') : "hm"
3030
>x.doOtherStuff : <T>(x: T) => T
3131
>x : string
3232
>doOtherStuff : <T>(x: T) => T
@@ -41,7 +41,7 @@ var c: string = x['doStuff']();
4141

4242
var d: string = x['doOtherStuff']('hm');
4343
>d : string
44-
>x['doOtherStuff']('hm') : string
44+
>x['doOtherStuff']('hm') : "hm"
4545
>x['doOtherStuff'] : <T>(x: T) => T
4646
>x : string
4747
>'doOtherStuff' : "doOtherStuff"
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
tests/cases/compiler/fixTypeParameterInSignatureWithRestParameters.ts(2,1): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
2-
Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'.
2+
Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate '""'.
33

44

55
==== tests/cases/compiler/fixTypeParameterInSignatureWithRestParameters.ts (1 errors) ====
66
function bar<T>(item1: T, item2: T) { }
77
bar(1, ""); // Should be ok
88
~~~
99
!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
10-
!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'.
10+
!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate '""'.

tests/baselines/reference/functionImplementations.types

+2-2
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ var un = function () {
139139
// FunctionExpression with no return type annotation and returns a type parameter type
140140
var n = function <T>(x: T) {
141141
>n : number
142-
>function <T>(x: T) { return x;} (4) : number
142+
>function <T>(x: T) { return x;} (4) : 4
143143
>function <T>(x: T) { return x;} : <T>(x: T) => T
144144
>T : T
145145
>x : T
@@ -154,7 +154,7 @@ var n = function <T>(x: T) {
154154
// FunctionExpression with no return type annotation and returns a constrained type parameter type
155155
var n = function <T extends {}>(x: T) {
156156
>n : number
157-
>function <T extends {}>(x: T) { return x;} (4) : number
157+
>function <T extends {}>(x: T) { return x;} (4) : 4
158158
>function <T extends {}>(x: T) { return x;} : <T extends {}>(x: T) => T
159159
>T : T
160160
>x : T

tests/baselines/reference/genericCallTypeArgumentInference.types

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function foo<T>(t: T) {
1313

1414
var r = foo(''); // string
1515
>r : string
16-
>foo('') : string
16+
>foo('') : ""
1717
>foo : <T>(t: T) => T
1818
>'' : ""
1919

@@ -47,7 +47,7 @@ function foo2b<T, U>(u: U) {
4747

4848
var r2 = foo2('', 1); // number
4949
>r2 : number
50-
>foo2('', 1) : number
50+
>foo2('', 1) : 1
5151
>foo2 : <T, U>(t: T, u: U) => U
5252
>'' : ""
5353
>1 : 1
@@ -198,7 +198,7 @@ var r5 = c.foo2('', 1); // number
198198

199199
var r6 = c.foo3(true, 1); // boolean
200200
>r6 : boolean
201-
>c.foo3(true, 1) : boolean
201+
>c.foo3(true, 1) : true
202202
>c.foo3 : <T>(t: T, u: number) => T
203203
>c : C<string, number>
204204
>foo3 : <T>(t: T, u: number) => T
@@ -216,7 +216,7 @@ var r7 = c.foo4('', true); // string
216216

217217
var r8 = c.foo5(true, 1); // boolean
218218
>r8 : boolean
219-
>c.foo5(true, 1) : boolean
219+
>c.foo5(true, 1) : true
220220
>c.foo5 : <T, U>(t: T, u: U) => T
221221
>c : C<string, number>
222222
>foo5 : <T, U>(t: T, u: U) => T
@@ -345,7 +345,7 @@ var r5 = i.foo2('', 1); // number
345345

346346
var r6 = i.foo3(true, 1); // boolean
347347
>r6 : boolean
348-
>i.foo3(true, 1) : boolean
348+
>i.foo3(true, 1) : true
349349
>i.foo3 : <T>(t: T, u: number) => T
350350
>i : I<string, number>
351351
>foo3 : <T>(t: T, u: number) => T
@@ -363,7 +363,7 @@ var r7 = i.foo4('', true); // string
363363

364364
var r8 = i.foo5(true, 1); // boolean
365365
>r8 : boolean
366-
>i.foo5(true, 1) : boolean
366+
>i.foo5(true, 1) : true
367367
>i.foo5 : <T, U>(t: T, u: U) => T
368368
>i : I<string, number>
369369
>foo5 : <T, U>(t: T, u: U) => T

tests/baselines/reference/genericCallWithFunctionTypedArguments.errors.txt

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(26,10): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
2-
Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'.
2+
Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'string'.
33
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(30,15): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
4-
Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'.
4+
Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'.
55
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(33,15): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
6-
Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'.
6+
Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'.
77
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(34,16): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
8-
Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'.
8+
Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'.
99
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(35,15): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
10-
Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'.
10+
Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'string'.
1111

1212

1313
==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts (5 errors) ====
@@ -39,26 +39,26 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFun
3939
var r8 = foo3(1, function (a) { return '' }, 1); // error
4040
~~~~
4141
!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
42-
!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'.
42+
!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'string'.
4343
var r9 = foo3<number, string>(1, (a) => '', ''); // string
4444

4545
function other<T, U>(t: T, u: U) {
4646
var r10 = foo2(1, (x: T) => ''); // error
4747
~~~~
4848
!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
49-
!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'.
49+
!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'.
5050
var r10 = foo2(1, (x) => ''); // string
5151

5252
var r11 = foo3(1, (x: T) => '', ''); // error
5353
~~~~
5454
!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
55-
!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'.
55+
!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'.
5656
var r11b = foo3(1, (x: T) => '', 1); // error
5757
~~~~
5858
!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
59-
!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'.
59+
!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'.
6060
var r12 = foo3(1, function (a) { return '' }, 1); // error
6161
~~~~
6262
!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
63-
!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'.
63+
!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'string'.
6464
}

tests/baselines/reference/genericCallWithFunctionTypedArguments2.errors.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments2.ts(29,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
2-
Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'.
2+
Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'string'.
33
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments2.ts(40,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
4-
Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'.
4+
Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'string'.
55

66

77
==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments2.ts (2 errors) ====
@@ -36,7 +36,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFun
3636
var r4 = foo2(1, i2); // error
3737
~~~~
3838
!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
39-
!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'.
39+
!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'string'.
4040
var r4b = foo2(1, a); // any
4141
var r5 = foo2(1, i); // any
4242
var r6 = foo2<string, string>('', i2); // string
@@ -50,5 +50,5 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFun
5050
var r8 = foo3(1, i2, 1); // error
5151
~~~~
5252
!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
53-
!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'.
53+
!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'string'.
5454
var r9 = foo3<string, string>('', i2, ''); // string

tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.errors.txt

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts(57,19): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
2-
Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'.
2+
Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'.
33
tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts(60,19): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
4-
Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'.
4+
Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'.
55
tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts(61,20): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
6-
Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'.
6+
Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'.
77
tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts(62,19): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
8-
Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'.
8+
Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'string'.
99

1010

1111
==== tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts (4 errors) ====
@@ -68,20 +68,20 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFu
6868
var r10 = c.foo2(1, (x: T) => ''); // error
6969
~~~~~~
7070
!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
71-
!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'.
71+
!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'.
7272
var r10 = c.foo2(1, (x) => ''); // string
7373

7474
var r11 = c3.foo3(1, (x: T) => '', ''); // error
7575
~~~~~~~
7676
!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
77-
!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'.
77+
!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'.
7878
var r11b = c3.foo3(1, (x: T) => '', 1); // error
7979
~~~~~~~
8080
!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
81-
!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'.
81+
!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'.
8282
var r12 = c3.foo3(1, function (a) { return '' }, 1); // error
8383
~~~~~~~
8484
!!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly.
85-
!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'.
85+
!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'string'.
8686
}
8787
}

tests/baselines/reference/genericFunctions1.types

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function foo<T > (x: T) { return x; }
88

99
var x = foo(5); // 'x' should be number
1010
>x : number
11-
>foo(5) : number
11+
>foo(5) : 5
1212
>foo : <T>(x: T) => T
1313
>5 : 5
1414

0 commit comments

Comments
 (0)