Skip to content

Commit 652bb12

Browse files
committed
Accept new baselines
1 parent 5a45d5a commit 652bb12

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

tests/baselines/reference/unionAndIntersectionInference2.types

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var e1: number | string | boolean;
2020
>e1 : string | number | boolean
2121

2222
f1(a1); // string
23-
>f1(a1) : string
23+
>f1(a1) : never
2424
>f1 : <T>(x: string | T) => T
2525
>a1 : string
2626

tests/baselines/reference/unionTypeInference.errors.txt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
tests/cases/conformance/types/typeRelationships/typeInference/unionTypeInference.ts(9,15): error TS2345: Argument of type '2' is not assignable to parameter of type 'string | 1'.
1+
tests/cases/conformance/types/typeRelationships/typeInference/unionTypeInference.ts(13,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a3' must be of type 'number', but here has type 'string | number'.
2+
tests/cases/conformance/types/typeRelationships/typeInference/unionTypeInference.ts(31,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'c2' must be of type 'string', but here has type 'never'.
23

34

4-
==== tests/cases/conformance/types/typeRelationships/typeInference/unionTypeInference.ts (1 errors) ====
5+
==== tests/cases/conformance/types/typeRelationships/typeInference/unionTypeInference.ts (2 errors) ====
56
// Verify that inferences made *to* a type parameter in a union type are secondary
67
// to inferences made directly to that type parameter
78

@@ -11,12 +12,13 @@ tests/cases/conformance/types/typeRelationships/typeInference/unionTypeInference
1112

1213
var a1: number;
1314
var a1 = f(1, 2);
14-
~
15-
!!! error TS2345: Argument of type '2' is not assignable to parameter of type 'string | 1'.
1615
var a2: number;
1716
var a2 = f(1, "hello");
1817
var a3: number;
1918
var a3 = f(1, a1 || "hello");
19+
~~
20+
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a3' must be of type 'number', but here has type 'string | number'.
21+
!!! related TS6203 tests/cases/conformance/types/typeRelationships/typeInference/unionTypeInference.ts:12:5: 'a3' was also declared here.
2022
var a4: any;
2123
var a4 = f(undefined, "abc");
2224

@@ -35,4 +37,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/unionTypeInference
3537
var c1 = h(5);
3638
var c2: string;
3739
var c2 = h("abc");
40+
~~
41+
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'c2' must be of type 'string', but here has type 'never'.
42+
!!! related TS6203 tests/cases/conformance/types/typeRelationships/typeInference/unionTypeInference.ts:30:5: 'c2' was also declared here.
3843

tests/baselines/reference/unionTypeInference.types

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var a1: number;
1616

1717
var a1 = f(1, 2);
1818
>a1 : number
19-
>f(1, 2) : any
19+
>f(1, 2) : 1 | 2
2020
>f : <T>(x: T, y: string | T) => T
2121
>1 : 1
2222
>2 : 2
@@ -36,7 +36,7 @@ var a3: number;
3636

3737
var a3 = f(1, a1 || "hello");
3838
>a3 : number
39-
>f(1, a1 || "hello") : number
39+
>f(1, a1 || "hello") : number | "hello"
4040
>f : <T>(x: T, y: string | T) => T
4141
>1 : 1
4242
>a1 || "hello" : number | "hello"
@@ -107,7 +107,7 @@ var c2: string;
107107

108108
var c2 = h("abc");
109109
>c2 : string
110-
>h("abc") : "abc"
110+
>h("abc") : never
111111
>h : <T>(x: string | boolean | T) => T
112112
>"abc" : "abc"
113113

0 commit comments

Comments
 (0)