Skip to content

Commit

Permalink
Accept new baselines
Browse files Browse the repository at this point in the history
  • Loading branch information
ahejlsberg committed Jan 29, 2021
1 parent d15a94f commit cb2d36e
Show file tree
Hide file tree
Showing 16 changed files with 31 additions and 31 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: 7, y: new derived() }, { x: 5, y: new base() }] : ({ x: number; y: derived; } | { x: number; y: base; })[]
>{ 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: string; y: derived; }[]
>[{ x: undefined, y: new base() }, { x: '', y: new derived() }] : ({ x: undefined; y: base; } | { 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: 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: 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[]
>[ new Action(), new ActionA(), new ActionB()] : (Action | ActionA | ActionB)[]

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[]
>[ new Action(), new ActionA(), new ActionB() ] : (Action | ActionA | ActionB)[]

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; 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; } | { 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 : 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)[]
>[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 : I11
>i21 : I21
>i11 || i21 : I11 | I21
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/reference/contextualTyping10.types
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class foo { public bar:{id:number;}[] = [{id:1}, {id:2}]; }
>foo : foo
>bar : { id: number; }[]
>id : number
>[{id:1}, {id:2}] : { id: number; }[]
>[{id:1}, {id:2}] : ({ id: number; } | { id: number; })[]
>{id:1} : { id: number; }
>id : number
>1 : 1
Expand Down
4 changes: 2 additions & 2 deletions tests/baselines/reference/contextualTyping19.types
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, {id:2}];
>{id:1} : { id: number; }
>id : number
>1 : 1
>foo = [{id:1}, {id:2}] : { id: number; }[]
>foo = [{id:1}, {id:2}] : ({ id: number; } | { id: number; })[]
>foo : { id: number; }[]
>[{id:1}, {id:2}] : { id: number; }[]
>[{id:1}, {id:2}] : ({ id: number; } | { id: number; })[]
>{id:1} : { id: number; }
>id : number
>1 : 1
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)[]
>[function(){return 1;}, function(){return 4}] : ((() => number) | (() => 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: 4 }, <{ id: number; }>({ })] : ({ id: number; } | { id: number; })[]
>{ id: 4 } : { id: number; }
>id : number
>4 : 4
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/reference/contextualTyping6.types
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
var foo:{id:number;}[] = [{id:1}, {id:2}];
>foo : { id: number; }[]
>id : number
>[{id:1}, {id:2}] : { id: number; }[]
>[{id:1}, {id:2}] : ({ id: number; } | { id: number; })[]
>{id:1} : { id: number; }
>id : number
>1 : 1
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/reference/lambdaParamTypes.types
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var thing = create([{ name: "bob", id: 24 }, { name: "doug", id: 32 }]);
>thing : MyArrayWrapper<{ name: string; id: number; }>
>create([{ name: "bob", id: 24 }, { name: "doug", id: 32 }]) : MyArrayWrapper<{ name: string; id: number; }>
>create : <T>(initialValues?: T[]) => MyArrayWrapper<T>
>[{ name: "bob", id: 24 }, { name: "doug", id: 32 }] : { name: string; id: number; }[]
>[{ name: "bob", id: 24 }, { name: "doug", id: 32 }] : ({ name: string; id: number; } | { name: string; id: number; })[]
>{ name: "bob", id: 24 } : { name: string; id: number; }
>name : string
>"bob" : "bob"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var thing = create([ { name: "bob", id: 24 }, { name: "doug", id: 32 } ]); // sh
>thing : MyArrayWrapper<{ name: string; id: number; }>
>create([ { name: "bob", id: 24 }, { name: "doug", id: 32 } ]) : MyArrayWrapper<{ name: string; id: number; }>
>create : <T>(initialValues?: T[]) => MyArrayWrapper<T>
>[ { name: "bob", id: 24 }, { name: "doug", id: 32 } ] : { name: string; id: number; }[]
>[ { name: "bob", id: 24 }, { name: "doug", id: 32 } ] : ({ name: string; id: number; } | { name: string; id: number; })[]
>{ name: "bob", id: 24 } : { name: string; id: number; }
>name : string
>"bob" : "bob"
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[])[])[])[]
>[1, [2, 3], [4, [5, [6, 7]]]] : (number | 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[][]
>[hs, [h]] : (HTMLHeadingElement[] | HTMLHeadingElement[])[]
>hs : HTMLHeadingElement[]
>[h] : HTMLHeadingElement[]
>h : HTMLHeadingElement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ interface MultiRobot {

let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }];
>robots : Robot[]
>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[]
>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : ({ name: string; skill: string; } | { name: string; skill: string; })[]
>{ name: "mower", skill: "mowing" } : { name: string; skill: string; }
>name : string
>"mower" : "mower"
Expand All @@ -46,7 +46,7 @@ let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", sk

let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } },
>multiRobots : MultiRobot[]
>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[]
>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : ({ name: string; skills: { primary: string; secondary: string; }; } | { name: string; skills: { primary: string; secondary: string; }; })[]
>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; }
>name : string
>"mower" : "mower"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ interface MultiRobot {

let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }];
>robots : Robot[]
>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[]
>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : ({ name: string; skill: string; } | { name: string; skill: string; })[]
>{ name: "mower", skill: "mowing" } : { name: string; skill: string; }
>name : string
>"mower" : "mower"
Expand All @@ -46,7 +46,7 @@ let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", sk

let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } },
>multiRobots : MultiRobot[]
>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[]
>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : ({ name: string; skills: { primary: string; secondary: string; }; } | { name: string; skills: { primary: string; secondary: string; }; })[]
>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; }
>name : string
>"mower" : "mower"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ interface MultiRobot {

let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }];
>robots : Robot[]
>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[]
>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : ({ name: string; skill: string; } | { name: string; skill: string; })[]
>{ name: "mower", skill: "mowing" } : { name: string; skill: string; }
>name : string
>"mower" : "mower"
Expand All @@ -46,7 +46,7 @@ let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", sk

let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } },
>multiRobots : MultiRobot[]
>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[]
>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : ({ name: string; skills: { primary: string; secondary: string; }; } | { name: string; skills: { primary: string; secondary: string; }; })[]
>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; }
>name : string
>"mower" : "mower"
Expand Down Expand Up @@ -199,7 +199,7 @@ for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "sec

<MultiRobot[]>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } },
><MultiRobot[]>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : MultiRobot[]
>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[]
>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : ({ name: string; skills: { primary: string; secondary: string; }; } | { name: string; skills: { primary: string; secondary: string; }; })[]
>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; }
>name : string
>"mower" : "mower"
Expand Down Expand Up @@ -389,7 +389,7 @@ for (let {

} of <MultiRobot[]>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } },
><MultiRobot[]>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : MultiRobot[]
>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[]
>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : ({ name: string; skills: { primary: string; secondary: string; }; } | { name: string; skills: { primary: string; secondary: string; }; })[]
>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; }
>name : string
>"mower" : "mower"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ interface MultiRobot {

let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }];
>robots : Robot[]
>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[]
>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : ({ name: string; skill: string; } | { name: string; skill: string; })[]
>{ name: "mower", skill: "mowing" } : { name: string; skill: string; }
>name : string
>"mower" : "mower"
Expand All @@ -46,7 +46,7 @@ let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", sk

let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } },
>multiRobots : MultiRobot[]
>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[]
>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : ({ name: string; skills: { primary: string; secondary: string; }; } | { name: string; skills: { primary: string; secondary: string; }; })[]
>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; }
>name : string
>"mower" : "mower"
Expand Down Expand Up @@ -233,7 +233,7 @@ for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "seconda

<MultiRobot[]>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } },
><MultiRobot[]>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : MultiRobot[]
>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[]
>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : ({ name: string; skills: { primary: string; secondary: string; }; } | { name: string; skills: { primary: string; secondary: string; }; })[]
>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; }
>name : string
>"mower" : "mower"
Expand Down Expand Up @@ -625,7 +625,7 @@ for ({

} of <MultiRobot[]>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } },
><MultiRobot[]>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : MultiRobot[]
>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[]
>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : ({ name: string; skills: { primary: string; secondary: string; }; } | { name: string; skills: { primary: string; secondary: string; }; })[]
>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; }
>name : string
>"mower" : "mower"
Expand Down
Loading

0 comments on commit cb2d36e

Please sign in to comment.