Skip to content

Commit

Permalink
Accepting new baselines
Browse files Browse the repository at this point in the history
  • Loading branch information
ahejlsberg authored and mhegazy committed Aug 29, 2015
1 parent d63a4f1 commit 2ee80f1
Show file tree
Hide file tree
Showing 40 changed files with 611 additions and 439 deletions.
44 changes: 22 additions & 22 deletions tests/baselines/reference/arrayBestCommonTypes.types
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ module EmptyTypes {

// Order matters here so test all the variants
var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }];
>a1 : ({ x: number; y: string; } | { x: string; y: string; } | { x: any; y: string; })[]
>[{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }] : ({ x: number; y: string; } | { x: string; y: string; } | { x: any; y: string; })[]
>a1 : { x: any; y: string; }[]
>[{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }] : { x: any; y: string; }[]
>{ x: 0, y: 'a' } : { x: number; y: string; }
>x : number
>0 : number
Expand All @@ -313,8 +313,8 @@ module EmptyTypes {
>'a' : string

var a2 = [{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }];
>a2 : ({ x: any; y: string; } | { x: number; y: string; } | { x: string; y: string; })[]
>[{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }] : ({ x: any; y: string; } | { x: number; y: string; } | { x: string; y: string; })[]
>a2 : { x: any; y: string; }[]
>[{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }] : { x: any; y: string; }[]
>{ x: anyObj, y: 'a' } : { x: any; y: string; }
>x : any
>anyObj : any
Expand All @@ -332,8 +332,8 @@ module EmptyTypes {
>'a' : string

var a3 = [{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }];
>a3 : ({ x: number; y: string; } | { x: any; y: string; } | { x: string; y: string; })[]
>[{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }] : ({ x: number; y: string; } | { x: any; y: string; } | { x: string; y: string; })[]
>a3 : { x: any; y: string; }[]
>[{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }] : { x: any; y: string; }[]
>{ x: 0, y: 'a' } : { x: number; y: string; }
>x : number
>0 : number
Expand Down Expand Up @@ -639,7 +639,7 @@ module NonEmptyTypes {
>x : number
>y : base
>base : 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 : number
Expand All @@ -658,7 +658,7 @@ module NonEmptyTypes {
>x : boolean
>y : base
>base : base
>[{ x: true, y: new derived() }, { x: false, y: new base() }] : ({ x: boolean; y: derived; } | { x: boolean; y: base; })[]
>[{ x: true, y: new derived() }, { x: false, y: new base() }] : { x: boolean; y: base; }[]
>{ x: true, y: new derived() } : { x: boolean; y: derived; }
>x : boolean
>true : boolean
Expand Down Expand Up @@ -697,8 +697,8 @@ module NonEmptyTypes {

// Order matters here so test all the variants
var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }];
>a1 : ({ x: number; y: string; } | { x: string; y: string; } | { x: any; y: string; })[]
>[{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }] : ({ x: number; y: string; } | { x: string; y: string; } | { x: any; y: string; })[]
>a1 : { x: any; y: string; }[]
>[{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }] : { x: any; y: string; }[]
>{ x: 0, y: 'a' } : { x: number; y: string; }
>x : number
>0 : number
Expand All @@ -716,8 +716,8 @@ module NonEmptyTypes {
>'a' : string

var a2 = [{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }];
>a2 : ({ x: any; y: string; } | { x: number; y: string; } | { x: string; y: string; })[]
>[{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }] : ({ x: any; y: string; } | { x: number; y: string; } | { x: string; y: string; })[]
>a2 : { x: any; y: string; }[]
>[{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }] : { x: any; y: string; }[]
>{ x: anyObj, y: 'a' } : { x: any; y: string; }
>x : any
>anyObj : any
Expand All @@ -735,8 +735,8 @@ module NonEmptyTypes {
>'a' : string

var a3 = [{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }];
>a3 : ({ x: number; y: string; } | { x: any; y: string; } | { x: string; y: string; })[]
>[{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }] : ({ x: number; y: string; } | { x: any; y: string; } | { x: string; y: string; })[]
>a3 : { x: any; y: string; }[]
>[{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }] : { x: any; y: string; }[]
>{ x: 0, y: 'a' } : { x: number; y: string; }
>x : number
>0 : number
Expand Down Expand Up @@ -769,29 +769,29 @@ module NonEmptyTypes {
>base2 : typeof base2

var b1 = [baseObj, base2Obj, ifaceObj];
>b1 : (base | base2 | iface)[]
>[baseObj, base2Obj, ifaceObj] : (base | base2 | iface)[]
>b1 : iface[]
>[baseObj, base2Obj, ifaceObj] : iface[]
>baseObj : base
>base2Obj : base2
>ifaceObj : iface

var b2 = [base2Obj, baseObj, ifaceObj];
>b2 : (base2 | base | iface)[]
>[base2Obj, baseObj, ifaceObj] : (base2 | base | iface)[]
>b2 : iface[]
>[base2Obj, baseObj, ifaceObj] : iface[]
>base2Obj : base2
>baseObj : base
>ifaceObj : iface

var b3 = [baseObj, ifaceObj, base2Obj];
>b3 : (base | iface | base2)[]
>[baseObj, ifaceObj, base2Obj] : (base | iface | base2)[]
>b3 : iface[]
>[baseObj, ifaceObj, base2Obj] : iface[]
>baseObj : base
>ifaceObj : iface
>base2Obj : base2

var b4 = [ifaceObj, baseObj, base2Obj];
>b4 : (iface | base | base2)[]
>[ifaceObj, baseObj, base2Obj] : (iface | base | base2)[]
>b4 : iface[]
>[ifaceObj, baseObj, base2Obj] : iface[]
>ifaceObj : iface
>baseObj : base
>base2Obj : base2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ var cs = [a, b, c]; // { x: number; y?: number };[]
>c : { x: number; a?: number; }

var ds = [(x: Object) => 1, (x: string) => 2]; // { (x:Object) => number }[]
>ds : (((x: Object) => number) | ((x: string) => number))[]
>[(x: Object) => 1, (x: string) => 2] : (((x: Object) => number) | ((x: string) => number))[]
>ds : ((x: Object) => number)[]
>[(x: Object) => 1, (x: string) => 2] : ((x: Object) => number)[]
>(x: Object) => 1 : (x: Object) => number
>x : Object
>Object : Object
Expand All @@ -47,8 +47,8 @@ var ds = [(x: Object) => 1, (x: string) => 2]; // { (x:Object) => number }[]
>2 : number

var es = [(x: string) => 2, (x: Object) => 1]; // { (x:string) => number }[]
>es : (((x: string) => number) | ((x: Object) => number))[]
>[(x: string) => 2, (x: Object) => 1] : (((x: string) => number) | ((x: Object) => number))[]
>es : ((x: string) => number)[]
>[(x: string) => 2, (x: Object) => 1] : ((x: string) => number)[]
>(x: string) => 2 : (x: string) => number
>x : string
>2 : number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ var myDerivedList: DerivedList<number>;
>DerivedList : DerivedList<U>

var as = [list, myDerivedList]; // List<number>[]
>as : (List<number> | DerivedList<number>)[]
>[list, myDerivedList] : (List<number> | DerivedList<number>)[]
>as : List<number>[]
>[list, myDerivedList] : List<number>[]
>list : List<number>
>myDerivedList : DerivedList<number>

35 changes: 0 additions & 35 deletions tests/baselines/reference/arrayOfFunctionTypes3.errors.txt

This file was deleted.

93 changes: 93 additions & 0 deletions tests/baselines/reference/arrayOfFunctionTypes3.symbols
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
=== tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayOfFunctionTypes3.ts ===
// valid uses of arrays of function types

var x = [() => 1, () => { }];
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 2, 3))

var r2 = x[0]();
>r2 : Symbol(r2, Decl(arrayOfFunctionTypes3.ts, 3, 3))
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 2, 3))

class C {
>C : Symbol(C, Decl(arrayOfFunctionTypes3.ts, 3, 16))

foo: string;
>foo : Symbol(foo, Decl(arrayOfFunctionTypes3.ts, 5, 9))
}
var y = [C, C];
>y : Symbol(y, Decl(arrayOfFunctionTypes3.ts, 8, 3))
>C : Symbol(C, Decl(arrayOfFunctionTypes3.ts, 3, 16))
>C : Symbol(C, Decl(arrayOfFunctionTypes3.ts, 3, 16))

var r3 = new y[0]();
>r3 : Symbol(r3, Decl(arrayOfFunctionTypes3.ts, 9, 3))
>y : Symbol(y, Decl(arrayOfFunctionTypes3.ts, 8, 3))

var a: { (x: number): number; (x: string): string; };
>a : Symbol(a, Decl(arrayOfFunctionTypes3.ts, 11, 3))
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 11, 10))
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 11, 31))

var b: { (x: number): number; (x: string): string; };
>b : Symbol(b, Decl(arrayOfFunctionTypes3.ts, 12, 3))
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 12, 10))
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 12, 31))

var c: { (x: number): number; (x: any): any; };
>c : Symbol(c, Decl(arrayOfFunctionTypes3.ts, 13, 3))
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 13, 10))
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 13, 31))

var z = [a, b, c];
>z : Symbol(z, Decl(arrayOfFunctionTypes3.ts, 14, 3))
>a : Symbol(a, Decl(arrayOfFunctionTypes3.ts, 11, 3))
>b : Symbol(b, Decl(arrayOfFunctionTypes3.ts, 12, 3))
>c : Symbol(c, Decl(arrayOfFunctionTypes3.ts, 13, 3))

var r4 = z[0];
>r4 : Symbol(r4, Decl(arrayOfFunctionTypes3.ts, 15, 3))
>z : Symbol(z, Decl(arrayOfFunctionTypes3.ts, 14, 3))

var r5 = r4(''); // any not string
>r5 : Symbol(r5, Decl(arrayOfFunctionTypes3.ts, 16, 3))
>r4 : Symbol(r4, Decl(arrayOfFunctionTypes3.ts, 15, 3))

var r5b = r4(1);
>r5b : Symbol(r5b, Decl(arrayOfFunctionTypes3.ts, 17, 3))
>r4 : Symbol(r4, Decl(arrayOfFunctionTypes3.ts, 15, 3))

var a2: { <T>(x: T): number; (x: string): string;};
>a2 : Symbol(a2, Decl(arrayOfFunctionTypes3.ts, 19, 3))
>T : Symbol(T, Decl(arrayOfFunctionTypes3.ts, 19, 11))
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 19, 14))
>T : Symbol(T, Decl(arrayOfFunctionTypes3.ts, 19, 11))
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 19, 30))

var b2: { <T>(x: T): number; (x: string): string; };
>b2 : Symbol(b2, Decl(arrayOfFunctionTypes3.ts, 20, 3))
>T : Symbol(T, Decl(arrayOfFunctionTypes3.ts, 20, 11))
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 20, 14))
>T : Symbol(T, Decl(arrayOfFunctionTypes3.ts, 20, 11))
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 20, 30))

var c2: { (x: number): number; <T>(x: T): any; };
>c2 : Symbol(c2, Decl(arrayOfFunctionTypes3.ts, 21, 3))
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 21, 11))
>T : Symbol(T, Decl(arrayOfFunctionTypes3.ts, 21, 32))
>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 21, 35))
>T : Symbol(T, Decl(arrayOfFunctionTypes3.ts, 21, 32))

var z2 = [a2, b2, c2];
>z2 : Symbol(z2, Decl(arrayOfFunctionTypes3.ts, 23, 3))
>a2 : Symbol(a2, Decl(arrayOfFunctionTypes3.ts, 19, 3))
>b2 : Symbol(b2, Decl(arrayOfFunctionTypes3.ts, 20, 3))
>c2 : Symbol(c2, Decl(arrayOfFunctionTypes3.ts, 21, 3))

var r6 = z2[0];
>r6 : Symbol(r6, Decl(arrayOfFunctionTypes3.ts, 24, 3))
>z2 : Symbol(z2, Decl(arrayOfFunctionTypes3.ts, 23, 3))

var r7 = r6(''); // any not string
>r7 : Symbol(r7, Decl(arrayOfFunctionTypes3.ts, 25, 3))
>r6 : Symbol(r6, Decl(arrayOfFunctionTypes3.ts, 24, 3))

Loading

0 comments on commit 2ee80f1

Please sign in to comment.