Skip to content

Commit

Permalink
Accept new baselines
Browse files Browse the repository at this point in the history
  • Loading branch information
ahejlsberg committed Feb 18, 2021
1 parent 0b62483 commit 781c1d7
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 7,034 deletions.
6 changes: 3 additions & 3 deletions tests/baselines/reference/arrayBestCommonTypes.types
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ module EmptyTypes {
>t1 : { x: number; y: base; }[]
>x : number
>y : base
>[{ x: 7, y: new derived() }, { x: 5, y: new base() }] : ({ x: number; y: derived; } | { x: number; y: base; })[]
>[{ x: 7, y: new derived() }, { x: 5, y: new base() }] : { x: number; y: derived; }[]
>{ x: 7, y: new derived() } : { x: number; y: derived; }
>x : number
>7 : 7
Expand Down Expand Up @@ -267,7 +267,7 @@ module EmptyTypes {
>t3 : { x: string; y: base; }[]
>x : string
>y : base
>[{ x: undefined, y: new base() }, { x: '', y: new derived() }] : ({ x: undefined; y: base; } | { x: string; y: derived; })[]
>[{ x: undefined, y: new base() }, { x: '', y: new derived() }] : { x: string; y: derived; }[]
>{ x: undefined, y: new base() } : { x: undefined; y: base; }
>x : undefined
>undefined : undefined
Expand Down Expand Up @@ -627,7 +627,7 @@ module NonEmptyTypes {
>t1 : { x: number; y: base; }[]
>x : number
>y : base
>[{ x: 7, y: new derived() }, { x: 5, y: new base() }] : ({ x: number; y: derived; } | { x: number; y: base; })[]
>[{ x: 7, y: new derived() }, { x: 5, y: new base() }] : { x: number; y: base; }[]
>{ x: 7, y: new derived() } : { x: number; y: derived; }
>x : number
>7 : 7
Expand Down
4 changes: 2 additions & 2 deletions tests/baselines/reference/arrayLiteralTypeInference.types
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ var x2: Action[] = [

var x3: Action[] = [
>x3 : Action[]
>[ new Action(), new ActionA(), new ActionB()] : (Action | ActionA | ActionB)[]
>[ new Action(), new ActionA(), new ActionB()] : Action[]

new Action(),
>new Action() : Action
Expand Down Expand Up @@ -119,7 +119,7 @@ var z3: { id: number }[] =
>id : number

[
>[ new Action(), new ActionA(), new ActionB() ] : (Action | ActionA | ActionB)[]
>[ new Action(), new ActionA(), new ActionB() ] : Action[]

new Action(),
>new Action() : Action
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ var i1Ori2: I1<number> | I2<number> = { // Like i1 and i2 both

var arrayI1OrI2: Array<I1<number> | I2<number>> = [i1, i2, { // Like i1
>arrayI1OrI2 : (I1<number> | I2<number>)[]
>[i1, i2, { // Like i1 commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello", }, { // Like i2 commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI2: a => a, propertyOnlyInI2: "Hello", }, { // Like i1 and i2 both commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello", methodOnlyInI2: a => a, propertyOnlyInI2: "Hello", }] : (I1<number> | I2<number> | { commonPropertyType: string; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI1: (a: string) => string; propertyOnlyInI1: string; } | { commonPropertyType: string; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI2: (a: string) => string; propertyOnlyInI2: string; } | { commonPropertyType: string; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI1: (a: string) => string; propertyOnlyInI1: string; methodOnlyInI2: (a: string) => string; propertyOnlyInI2: string; })[]
>[i1, i2, { // Like i1 commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello", }, { // Like i2 commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI2: a => a, propertyOnlyInI2: "Hello", }, { // Like i1 and i2 both commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello", methodOnlyInI2: a => a, propertyOnlyInI2: "Hello", }] : (I1<number> | I2<number> | { commonPropertyType: string; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI1: (a: string) => string; propertyOnlyInI1: string; methodOnlyInI2: (a: string) => string; propertyOnlyInI2: string; })[]
>i1 : I1<number>
>i2 : I2<number>
>{ // Like i1 commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello", } : { commonPropertyType: string; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI1: (a: string) => string; propertyOnlyInI1: string; }
Expand Down Expand Up @@ -354,7 +354,7 @@ var i11Ori21: I11 | I21 = {
};
var arrayOrI11OrI21: Array<I11 | I21> = [i11, i21, i11 || i21, {
>arrayOrI11OrI21 : (I11 | I21)[]
>[i11, i21, i11 || i21, { // Like i1 commonMethodDifferentReturnType: (a, b) => { var z = a.charAt(b); return z; }, commonPropertyDifferentType: "hello", }, { // Like i2 commonMethodDifferentReturnType: (a, b) => { var z = a.charCodeAt(b); return z; }, commonPropertyDifferentType: 10, }] : (I11 | I21 | { commonMethodDifferentReturnType: (a: string, b: number) => string; commonPropertyDifferentType: string; } | { commonMethodDifferentReturnType: (a: string, b: number) => number; commonPropertyDifferentType: number; })[]
>[i11, i21, i11 || i21, { // Like i1 commonMethodDifferentReturnType: (a, b) => { var z = a.charAt(b); return z; }, commonPropertyDifferentType: "hello", }, { // Like i2 commonMethodDifferentReturnType: (a, b) => { var z = a.charCodeAt(b); return z; }, commonPropertyDifferentType: 10, }] : (I11 | I21)[]
>i11 : I11
>i21 : I21
>i11 || i21 : I11 | I21
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/reference/contextualTyping32.types
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function foo(param: {():number; (i:number):number; }[]) { }; foo([function(){ret
>i : number
>foo([function(){return 1;}, function(){return 4}]) : void
>foo : (param: { (): number; (i: number): number; }[]) => void
>[function(){return 1;}, function(){return 4}] : ((() => number) | (() => number))[]
>[function(){return 1;}, function(){return 4}] : (() => number)[]
>function(){return 1;} : () => number
>1 : 1
>function(){return 4} : () => number
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/reference/contextualTyping36.types
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var foo = <{ id: number; }[]>[{ id: 4 }, <{ id: number; }>({ })];
>foo : { id: number; }[]
><{ id: number; }[]>[{ id: 4 }, <{ id: number; }>({ })] : { id: number; }[]
>id : number
>[{ id: 4 }, <{ id: number; }>({ })] : ({ id: number; } | { id: number; })[]
>[{ id: 4 }, <{ id: number; }>({ })] : { id: number; }[]
>{ id: 4 } : { id: number; }
>id : number
>4 : 4
Expand Down
4 changes: 2 additions & 2 deletions tests/baselines/reference/recursiveTypeReferences1.types
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const a0: ValueOrArray<number> = 1;

const a1: ValueOrArray<number> = [1, [2, 3], [4, [5, [6, 7]]]];
>a1 : ValueOrArray<number>
>[1, [2, 3], [4, [5, [6, 7]]]] : (number | number[] | (number | (number | number[])[])[])[]
>[1, [2, 3], [4, [5, [6, 7]]]] : (number | (number | (number | number[])[])[])[]
>1 : 1
>[2, 3] : number[]
>2 : 2
Expand Down Expand Up @@ -538,7 +538,7 @@ function cons(hs: HTMLHeadingElement[]): Tree {
>concat(hss, [hs, [h]]) : any
>concat : any
>hss : HTMLHeadingElement[][]
>[hs, [h]] : (HTMLHeadingElement[] | HTMLHeadingElement[])[]
>[hs, [h]] : HTMLHeadingElement[][]
>hs : HTMLHeadingElement[]
>[h] : HTMLHeadingElement[]
>h : HTMLHeadingElement
Expand Down
4 changes: 2 additions & 2 deletions tests/baselines/reference/underscoreTest1.types
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ _.flatten([1, [2], [3, [[4]]]]);
>_.flatten : { <T>(list: T[][]): T[]; <T>(array: any[], shallow?: boolean): T[]; }
>_ : Underscore.Static
>flatten : { <T>(list: T[][]): T[]; <T>(array: any[], shallow?: boolean): T[]; }
>[1, [2], [3, [[4]]]] : (number | number[] | (number | number[][])[])[]
>[1, [2], [3, [[4]]]] : (number | (number | number[][])[])[]
>1 : 1
>[2] : number[]
>2 : 2
Expand All @@ -562,7 +562,7 @@ _.flatten([1, [2], [3, [[4]]]], true);
>_.flatten : { <T>(list: T[][]): T[]; <T>(array: any[], shallow?: boolean): T[]; }
>_ : Underscore.Static
>flatten : { <T>(list: T[][]): T[]; <T>(array: any[], shallow?: boolean): T[]; }
>[1, [2], [3, [[4]]]] : (number | number[] | (number | number[][])[])[]
>[1, [2], [3, [[4]]]] : (number | (number | number[][])[])[]
>1 : 1
>[2] : number[]
>2 : 2
Expand Down
Loading

0 comments on commit 781c1d7

Please sign in to comment.