TypeScript/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.types
2015-04-13 14:29:37 -07:00

71 lines
3.6 KiB
Plaintext

=== tests/cases/compiler/declarationEmitDestructuringArrayPattern2.ts ===
var [x10, [y10, [z10]]] = [1, ["hello", [true]]];
>x10 : number, Symbol(x10, Decl(declarationEmitDestructuringArrayPattern2.ts, 0, 5))
>y10 : string, Symbol(y10, Decl(declarationEmitDestructuringArrayPattern2.ts, 0, 11))
>z10 : boolean, Symbol(z10, Decl(declarationEmitDestructuringArrayPattern2.ts, 0, 17))
>[1, ["hello", [true]]] : [number, [string, [boolean]]]
>1 : number
>["hello", [true]] : [string, [boolean]]
>"hello" : string
>[true] : [boolean]
>true : boolean
var [x11 = 0, y11 = ""] = [1, "hello"];
>x11 : number, Symbol(x11, Decl(declarationEmitDestructuringArrayPattern2.ts, 2, 5))
>0 : number
>y11 : string, Symbol(y11, Decl(declarationEmitDestructuringArrayPattern2.ts, 2, 13))
>"" : string
>[1, "hello"] : [number, string]
>1 : number
>"hello" : string
var [a11, b11, c11] = [];
>a11 : any, Symbol(a11, Decl(declarationEmitDestructuringArrayPattern2.ts, 3, 5))
>b11 : any, Symbol(b11, Decl(declarationEmitDestructuringArrayPattern2.ts, 3, 9))
>c11 : any, Symbol(c11, Decl(declarationEmitDestructuringArrayPattern2.ts, 3, 14))
>[] : undefined[]
var [a2, [b2, { x12, y12: c2 }]=["abc", { x12: 10, y12: false }]] = [1, ["hello", { x12: 5, y12: true }]];
>a2 : number, Symbol(a2, Decl(declarationEmitDestructuringArrayPattern2.ts, 5, 5))
>b2 : string, Symbol(b2, Decl(declarationEmitDestructuringArrayPattern2.ts, 5, 10))
>x12 : number, Symbol(x12, Decl(declarationEmitDestructuringArrayPattern2.ts, 5, 15))
>y12 : any
>c2 : boolean, Symbol(c2, Decl(declarationEmitDestructuringArrayPattern2.ts, 5, 20))
>["abc", { x12: 10, y12: false }] : [string, { x12: number; y12: boolean; }]
>"abc" : string
>{ x12: 10, y12: false } : { x12: number; y12: boolean; }
>x12 : number, Symbol(x12, Decl(declarationEmitDestructuringArrayPattern2.ts, 5, 41))
>10 : number
>y12 : boolean, Symbol(y12, Decl(declarationEmitDestructuringArrayPattern2.ts, 5, 50))
>false : boolean
>[1, ["hello", { x12: 5, y12: true }]] : [number, [string, { x12: number; y12: boolean; }]]
>1 : number
>["hello", { x12: 5, y12: true }] : [string, { x12: number; y12: boolean; }]
>"hello" : string
>{ x12: 5, y12: true } : { x12: number; y12: boolean; }
>x12 : number, Symbol(x12, Decl(declarationEmitDestructuringArrayPattern2.ts, 5, 83))
>5 : number
>y12 : boolean, Symbol(y12, Decl(declarationEmitDestructuringArrayPattern2.ts, 5, 91))
>true : boolean
var [x13, y13] = [1, "hello"];
>x13 : number, Symbol(x13, Decl(declarationEmitDestructuringArrayPattern2.ts, 7, 5))
>y13 : string, Symbol(y13, Decl(declarationEmitDestructuringArrayPattern2.ts, 7, 9))
>[1, "hello"] : [number, string]
>1 : number
>"hello" : string
var [a3, b3] = [[x13, y13], { x: x13, y: y13 }];
>a3 : (string | number)[], Symbol(a3, Decl(declarationEmitDestructuringArrayPattern2.ts, 8, 5))
>b3 : { x: number; y: string; }, Symbol(b3, Decl(declarationEmitDestructuringArrayPattern2.ts, 8, 8))
>[[x13, y13], { x: x13, y: y13 }] : [(string | number)[], { x: number; y: string; }]
>[x13, y13] : (string | number)[]
>x13 : number, Symbol(x13, Decl(declarationEmitDestructuringArrayPattern2.ts, 7, 5))
>y13 : string, Symbol(y13, Decl(declarationEmitDestructuringArrayPattern2.ts, 7, 9))
>{ x: x13, y: y13 } : { x: number; y: string; }
>x : number, Symbol(x, Decl(declarationEmitDestructuringArrayPattern2.ts, 8, 29))
>x13 : number, Symbol(x13, Decl(declarationEmitDestructuringArrayPattern2.ts, 7, 5))
>y : string, Symbol(y, Decl(declarationEmitDestructuringArrayPattern2.ts, 8, 37))
>y13 : string, Symbol(y13, Decl(declarationEmitDestructuringArrayPattern2.ts, 7, 9))