Skip to content

Commit c9a42c1

Browse files
committed
Accepting new baselines
1 parent 4e02b9f commit c9a42c1

12 files changed

+33
-33
lines changed

tests/baselines/reference/aliasUsageInOrExpression.types

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ var f: { x: IHasVisualizationModel } = <{ x: IHasVisualizationModel }>null ? { x
5353
>f : { x: IHasVisualizationModel; }
5454
>x : IHasVisualizationModel
5555
>IHasVisualizationModel : IHasVisualizationModel
56-
><{ x: IHasVisualizationModel }>null ? { x: moduleA } : null : { x: IHasVisualizationModel; }
56+
><{ x: IHasVisualizationModel }>null ? { x: moduleA } : null : { x: typeof moduleA; }
5757
><{ x: IHasVisualizationModel }>null : { x: IHasVisualizationModel; }
5858
>x : IHasVisualizationModel
5959
>IHasVisualizationModel : IHasVisualizationModel

tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types

+3-3
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ var r7: (x: Object) => void = true ? (x: number) => { } : (x: Object) => { };
7272
>r7 : (x: Object) => void
7373
>x : Object
7474
>Object : Object
75-
>true ? (x: number) => { } : (x: Object) => { } : (x: Object) => void
75+
>true ? (x: number) => { } : (x: Object) => { } : (x: number) => void
7676
>(x: number) => { } : (x: number) => void
7777
>x : number
7878
>(x: Object) => { } : (x: Object) => void
@@ -91,7 +91,7 @@ var r8 = true ? (x: Object) => { } : (x: number) => { }; // returns Object => vo
9191
var r10: Base = true ? derived : derived2; // no error since we use the contextual type in BCT
9292
>r10 : Base
9393
>Base : Base
94-
>true ? derived : derived2 : Base
94+
>true ? derived : derived2 : Derived | Derived2
9595
>derived : Derived
9696
>derived2 : Derived2
9797

@@ -112,7 +112,7 @@ function foo5<T, U>(t: T, u: U): Object {
112112
>Object : Object
113113

114114
return true ? t : u; // BCT is Object
115-
>true ? t : u : Object
115+
>true ? t : u : T | U
116116
>t : T
117117
>u : U
118118
}

tests/baselines/reference/conditionalOperatorWithIdenticalBCT.types

+5-5
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ var result4: (t: A) => any = true ? (m) => m.propertyX : (n) => n.propertyA;
8080
>result4 : (t: A) => any
8181
>t : A
8282
>A : A
83-
>true ? (m) => m.propertyX : (n) => n.propertyA : (t: A) => any
83+
>true ? (m) => m.propertyX : (n) => n.propertyA : (m: A) => any
8484
>(m) => m.propertyX : (m: A) => any
8585
>m : A
8686
>m.propertyX : any
@@ -144,7 +144,7 @@ var result8: (t: A) => any = true ? (m) => m.propertyA : (n) => n.propertyX;
144144
>result8 : (t: A) => any
145145
>t : A
146146
>A : A
147-
>true ? (m) => m.propertyA : (n) => n.propertyX : (t: A) => any
147+
>true ? (m) => m.propertyA : (n) => n.propertyX : (n: A) => any
148148
>(m) => m.propertyA : (m: A) => number
149149
>m : A
150150
>m.propertyA : number
@@ -161,15 +161,15 @@ var result8: (t: A) => any = true ? (m) => m.propertyA : (n) => n.propertyX;
161161
var resultIsX3: X = true ? a : b;
162162
>resultIsX3 : X
163163
>X : X
164-
>true ? a : b : X
164+
>true ? a : b : A | B
165165
>a : A
166166
>b : B
167167

168168
var result10: (t: X) => any = true ? (m) => m.propertyX1 : (n) => n.propertyX2;
169169
>result10 : (t: X) => any
170170
>t : X
171171
>X : X
172-
>true ? (m) => m.propertyX1 : (n) => n.propertyX2 : (t: X) => any
172+
>true ? (m) => m.propertyX1 : (n) => n.propertyX2 : { (m: X): number; } | { (n: X): string; }
173173
>(m) => m.propertyX1 : (m: X) => number
174174
>m : X
175175
>m.propertyX1 : number
@@ -184,5 +184,5 @@ var result10: (t: X) => any = true ? (m) => m.propertyX1 : (n) => n.propertyX2;
184184
//Expr1 and Expr2 are literals
185185
var result11: any = true ? 1 : 'string';
186186
>result11 : any
187-
>true ? 1 : 'string' : any
187+
>true ? 1 : 'string' : string | number
188188

tests/baselines/reference/contextualTypingOfConditionalExpression.types

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
var x: (a: number) => void = true ? (a) => a.toExponential() : (b) => b.toFixed();
33
>x : (a: number) => void
44
>a : number
5-
>true ? (a) => a.toExponential() : (b) => b.toFixed() : (a: number) => void
5+
>true ? (a) => a.toExponential() : (b) => b.toFixed() : (a: number) => string
66
>(a) => a.toExponential() : (a: number) => string
77
>a : number
88
>a.toExponential() : string
@@ -41,7 +41,7 @@ var x2: (a: A) => void = true ? (a) => a.foo : (b) => b.foo;
4141
>x2 : (a: A) => void
4242
>a : A
4343
>A : A
44-
>true ? (a) => a.foo : (b) => b.foo : (a: A) => void
44+
>true ? (a) => a.foo : (b) => b.foo : (a: A) => number
4545
>(a) => a.foo : (a: A) => number
4646
>a : A
4747
>a.foo : number

tests/baselines/reference/contextuallyTypingOrOperator.types

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var v: { a: (_: string) => number } = { a: s => s.length } || { a: s => 1 };
33
>v : { a: (_: string) => number; }
44
>a : (_: string) => number
55
>_ : string
6-
>{ a: s => s.length } || { a: s => 1 } : { a: (_: string) => number; }
6+
>{ a: s => s.length } || { a: s => 1 } : { a: (s: string) => number; }
77
>{ a: s => s.length } : { a: (s: string) => number; }
88
>a : (s: string) => number
99
>s => s.length : (s: string) => number

tests/baselines/reference/contextuallyTypingOrOperator2.types

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var v: { a: (_: string) => number } = { a: s => s.length } || { a: s => 1 };
33
>v : { a: (_: string) => number; }
44
>a : (_: string) => number
55
>_ : string
6-
>{ a: s => s.length } || { a: s => 1 } : { a: (_: string) => number; }
6+
>{ a: s => s.length } || { a: s => 1 } : { a: (s: string) => number; }
77
>{ a: s => s.length } : { a: (s: string) => number; }
88
>a : (s: string) => number
99
>s => s.length : (s: string) => number

tests/baselines/reference/generatedContextualTyping.types

+12-12
Original file line numberDiff line numberDiff line change
@@ -2616,7 +2616,7 @@ var x267: { [n: number]: Base; } = [d1, d2] || undefined;
26162616
>x267 : { [x: number]: Base; }
26172617
>n : number
26182618
>Base : Base
2619-
>[d1, d2] || undefined : { [x: number]: Base; }
2619+
>[d1, d2] || undefined : Base[]
26202620
>[d1, d2] : Base[]
26212621
>d1 : Derived1
26222622
>d2 : Derived2
@@ -2699,7 +2699,7 @@ var x275: { [n: number]: Base; } = undefined || [d1, d2];
26992699
>x275 : { [x: number]: Base; }
27002700
>n : number
27012701
>Base : Base
2702-
>undefined || [d1, d2] : { [x: number]: Base; }
2702+
>undefined || [d1, d2] : Base[]
27032703
>undefined : undefined
27042704
>[d1, d2] : Base[]
27052705
>d1 : Derived1
@@ -2800,7 +2800,7 @@ var x283: { [n: number]: Base; } = [d1, d2] || [d1, d2];
28002800
>x283 : { [x: number]: Base; }
28012801
>n : number
28022802
>Base : Base
2803-
>[d1, d2] || [d1, d2] : { [x: number]: Base; }
2803+
>[d1, d2] || [d1, d2] : Base[]
28042804
>[d1, d2] : Base[]
28052805
>d1 : Derived1
28062806
>d2 : Derived2
@@ -2933,7 +2933,7 @@ var x293: { [n: number]: Base; } = true ? [d1, d2] : [d1, d2];
29332933
>x293 : { [x: number]: Base; }
29342934
>n : number
29352935
>Base : Base
2936-
>true ? [d1, d2] : [d1, d2] : { [x: number]: Base; }
2936+
>true ? [d1, d2] : [d1, d2] : Base[]
29372937
>[d1, d2] : Base[]
29382938
>d1 : Derived1
29392939
>d2 : Derived2
@@ -2961,7 +2961,7 @@ var x295: (s: Base[]) => any = true ? n => { var n: Base[]; return null; } : n =
29612961
>x295 : (s: Base[]) => any
29622962
>s : Base[]
29632963
>Base : Base
2964-
>true ? n => { var n: Base[]; return null; } : n => { var n: Base[]; return null; } : (s: Base[]) => any
2964+
>true ? n => { var n: Base[]; return null; } : n => { var n: Base[]; return null; } : (n: Base[]) => any
29652965
>n => { var n: Base[]; return null; } : (n: Base[]) => any
29662966
>n : Base[]
29672967
>n : Base[]
@@ -2975,7 +2975,7 @@ var x296: Genric<Base> = true ? { func: n => { return [d1, d2]; } } : { func: n
29752975
>x296 : Genric<Base>
29762976
>Genric : Genric<T>
29772977
>Base : Base
2978-
>true ? { func: n => { return [d1, d2]; } } : { func: n => { return [d1, d2]; } } : Genric<Base>
2978+
>true ? { func: n => { return [d1, d2]; } } : { func: n => { return [d1, d2]; } } : { func: (n: Base[]) => Array<Derived1 | Derived2>; }
29792979
>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => Array<Derived1 | Derived2>; }
29802980
>func : (n: Base[]) => Array<Derived1 | Derived2>
29812981
>n => { return [d1, d2]; } : (n: Base[]) => Array<Derived1 | Derived2>
@@ -3076,7 +3076,7 @@ var x305: { [n: number]: Base; } = true ? undefined : [d1, d2];
30763076
>x305 : { [x: number]: Base; }
30773077
>n : number
30783078
>Base : Base
3079-
>true ? undefined : [d1, d2] : { [x: number]: Base; }
3079+
>true ? undefined : [d1, d2] : Base[]
30803080
>undefined : undefined
30813081
>[d1, d2] : Base[]
30823082
>d1 : Derived1
@@ -3098,7 +3098,7 @@ var x307: (s: Base[]) => any = true ? undefined : n => { var n: Base[]; return n
30983098
>x307 : (s: Base[]) => any
30993099
>s : Base[]
31003100
>Base : Base
3101-
>true ? undefined : n => { var n: Base[]; return null; } : (s: Base[]) => any
3101+
>true ? undefined : n => { var n: Base[]; return null; } : (n: Base[]) => any
31023102
>undefined : undefined
31033103
>n => { var n: Base[]; return null; } : (n: Base[]) => any
31043104
>n : Base[]
@@ -3109,7 +3109,7 @@ var x308: Genric<Base> = true ? undefined : { func: n => { return [d1, d2]; } };
31093109
>x308 : Genric<Base>
31103110
>Genric : Genric<T>
31113111
>Base : Base
3112-
>true ? undefined : { func: n => { return [d1, d2]; } } : Genric<Base>
3112+
>true ? undefined : { func: n => { return [d1, d2]; } } : { func: (n: Base[]) => Array<Derived1 | Derived2>; }
31133113
>undefined : undefined
31143114
>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => Array<Derived1 | Derived2>; }
31153115
>func : (n: Base[]) => Array<Derived1 | Derived2>
@@ -3204,7 +3204,7 @@ var x317: { [n: number]: Base; } = true ? [d1, d2] : undefined;
32043204
>x317 : { [x: number]: Base; }
32053205
>n : number
32063206
>Base : Base
3207-
>true ? [d1, d2] : undefined : { [x: number]: Base; }
3207+
>true ? [d1, d2] : undefined : Base[]
32083208
>[d1, d2] : Base[]
32093209
>d1 : Derived1
32103210
>d2 : Derived2
@@ -3226,7 +3226,7 @@ var x319: (s: Base[]) => any = true ? n => { var n: Base[]; return null; } : und
32263226
>x319 : (s: Base[]) => any
32273227
>s : Base[]
32283228
>Base : Base
3229-
>true ? n => { var n: Base[]; return null; } : undefined : (s: Base[]) => any
3229+
>true ? n => { var n: Base[]; return null; } : undefined : (n: Base[]) => any
32303230
>n => { var n: Base[]; return null; } : (n: Base[]) => any
32313231
>n : Base[]
32323232
>n : Base[]
@@ -3237,7 +3237,7 @@ var x320: Genric<Base> = true ? { func: n => { return [d1, d2]; } } : undefined;
32373237
>x320 : Genric<Base>
32383238
>Genric : Genric<T>
32393239
>Base : Base
3240-
>true ? { func: n => { return [d1, d2]; } } : undefined : Genric<Base>
3240+
>true ? { func: n => { return [d1, d2]; } } : undefined : { func: (n: Base[]) => Array<Derived1 | Derived2>; }
32413241
>{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => Array<Derived1 | Derived2>; }
32423242
>func : (n: Base[]) => Array<Derived1 | Derived2>
32433243
>n => { return [d1, d2]; } : (n: Base[]) => Array<Derived1 | Derived2>

tests/baselines/reference/genericCallWithObjectTypeArgs2.types

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ var r = f({ x: new Derived(), y: new Derived2() }); // {}[]
5757

5858
var r2 = f({ x: new Base(), y: new Derived2() }); // {}[]
5959
>r2 : Base[]
60-
>f({ x: new Base(), y: new Derived2() }) : Base[]
60+
>f({ x: new Base(), y: new Derived2() }) : Array<Base | Derived2>
6161
>f : <T extends Base, U extends Base>(a: { x: T; y: U; }) => Array<T | U>
6262
>{ x: new Base(), y: new Derived2() } : { x: Base; y: Derived2; }
6363
>x : Base

tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.types

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
var r: { a: string } = { a: '', b: 123 } || { a: '', b: true };
88
>r : { a: string; }
99
>a : string
10-
>{ a: '', b: 123 } || { a: '', b: true } : { a: string; }
10+
>{ a: '', b: 123 } || { a: '', b: true } : { a: string; b: number; } | { a: string; b: boolean; }
1111
>{ a: '', b: 123 } : { a: string; b: number; }
1212
>a : string
1313
>b : number

tests/baselines/reference/logicalOrOperatorWithTypeParameters.types

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function fn1<T, U>(t: T, u: U) {
2929

3030
var r4: {} = t || u;
3131
>r4 : {}
32-
>t || u : {}
32+
>t || u : T | U
3333
>t : T
3434
>u : U
3535
}
@@ -74,7 +74,7 @@ function fn2<T, U/* extends T*/, V/* extends T*/>(t: T, u: U, v: V) {
7474

7575
var r6: {} = u || v;
7676
>r6 : {}
77-
>u || v : {}
77+
>u || v : U | V
7878
>u : U
7979
>v : V
8080

@@ -102,7 +102,7 @@ function fn3<T extends { a: string; b: string }, U extends { a: string; b: numbe
102102

103103
var r2: {} = t || u;
104104
>r2 : {}
105-
>t || u : {}
105+
>t || u : T | U
106106
>t : T
107107
>u : U
108108

@@ -116,7 +116,7 @@ function fn3<T extends { a: string; b: string }, U extends { a: string; b: numbe
116116
var r4: { a: string } = t || u;
117117
>r4 : { a: string; }
118118
>a : string
119-
>t || u : { a: string; }
119+
>t || u : T | U
120120
>t : T
121121
>u : U
122122
}

tests/baselines/reference/returnTypeParameterWithModules.types

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module M1 {
2121
>reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; <U>(callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; }
2222
>apply : (thisArg: any, argArray?: any) => any
2323
>ar : any
24-
>e ? [f, e] : [f] : any
24+
>e ? [f, e] : [f] : any[]
2525
>e : any
2626
>[f, e] : any[]
2727
>f : any

tests/baselines/reference/underscoreTest1.types

+1-1
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ _.countBy([1, 2, 3, 4, 5], (num) => num % 2 == 0 ? 'even' : 'odd');
309309
>[1, 2, 3, 4, 5] : number[]
310310
>(num) => num % 2 == 0 ? 'even' : 'odd' : (num: number) => string
311311
>num : number
312-
>num % 2 == 0 ? 'even' : 'odd' : any
312+
>num % 2 == 0 ? 'even' : 'odd' : string
313313
>num % 2 == 0 : boolean
314314
>num % 2 : number
315315
>num : number

0 commit comments

Comments
 (0)