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

Lines changed: 5 additions & 5 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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"
Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 6 additions & 6 deletions
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

0 commit comments

Comments
 (0)