=== tests/cases/conformance/expressions/arrayLiterals/arrayLiterals2ES5.ts ===
// ElementList:  ( Modified )
//      Elisionopt   AssignmentExpression
//      Elisionopt   SpreadElement
//      ElementList, Elisionopt   AssignmentExpression
//      ElementList, Elisionopt   SpreadElement

// SpreadElement:
//      ...   AssignmentExpression

var a0 = [,, 2, 3, 4]
>a0 : number[]
>[,, 2, 3, 4] : number[]
> : undefined
> : undefined
>2 : number
>3 : number
>4 : number

var a1 = ["hello", "world"]
>a1 : string[]
>["hello", "world"] : string[]
>"hello" : string
>"world" : string

var a2 = [, , , ...a0, "hello"];
>a2 : (number | string)[]
>[, , , ...a0, "hello"] : (number | string)[]
> : undefined
> : undefined
> : undefined
>...a0 : number
>a0 : number[]
>"hello" : string

var a3 = [,, ...a0]
>a3 : number[]
>[,, ...a0] : number[]
> : undefined
> : undefined
>...a0 : number
>a0 : number[]

var a4 = [() => 1, ];
>a4 : (() => number)[]
>[() => 1, ] : (() => number)[]
>() => 1 : () => number
>1 : number

var a5 = [...a0, , ]
>a5 : number[]
>[...a0, , ] : number[]
>...a0 : number
>a0 : number[]
> : undefined

// Each element expression in a non-empty array literal is processed as follows:
//    - If the array literal contains no spread elements, and if the array literal is contextually typed (section 4.19)
//      by a type T and T has a property with the numeric name N, where N is the index of the element expression in the array literal,
//      the element expression is contextually typed by the type of that property.

// The resulting type an array literal expression is determined as follows:
//     - If the array literal contains no spread elements and is contextually typed by a tuple-like type,
//       the resulting type is a tuple type constructed from the types of the element expressions.

var b0: [any, any, any] = [undefined, null, undefined];
>b0 : [any, any, any]
>[undefined, null, undefined] : [undefined, null, undefined]
>undefined : undefined
>null : null
>undefined : undefined

var b1: [number[], string[]] = [[1, 2, 3], ["hello", "string"]];
>b1 : [number[], string[]]
>[[1, 2, 3], ["hello", "string"]] : [number[], string[]]
>[1, 2, 3] : number[]
>1 : number
>2 : number
>3 : number
>["hello", "string"] : string[]
>"hello" : string
>"string" : string

// The resulting type an array literal expression is determined as follows:
//     - If the array literal contains no spread elements and is an array assignment pattern in a destructuring assignment (section 4.17.1),
//       the resulting type is a tuple type constructed from the types of the element expressions.

var [c0, c1] = [1, 2];        // tuple type [number, number]
>c0 : number
>c1 : number
>[1, 2] : [number, number]
>1 : number
>2 : number

var [c2, c3] = [1, 2, true];  // tuple type [number, number, boolean]
>c2 : number
>c3 : number
>[1, 2, true] : [number, number, boolean]
>1 : number
>2 : number
>true : boolean

// The resulting type an array literal expression is determined as follows:
//      - the resulting type is an array type with an element type that is the union of the types of the
//        non - spread element expressions and the numeric index signature types of the spread element expressions
var temp = ["s", "t", "r"];
>temp : string[]
>["s", "t", "r"] : string[]
>"s" : string
>"t" : string
>"r" : string

var temp1 = [1, 2, 3];
>temp1 : number[]
>[1, 2, 3] : number[]
>1 : number
>2 : number
>3 : number

var temp2: [number[], string[]] = [[1, 2, 3], ["hello", "string"]];
>temp2 : [number[], string[]]
>[[1, 2, 3], ["hello", "string"]] : [number[], string[]]
>[1, 2, 3] : number[]
>1 : number
>2 : number
>3 : number
>["hello", "string"] : string[]
>"hello" : string
>"string" : string

var temp3 = [undefined, null, undefined];
>temp3 : any[]
>[undefined, null, undefined] : null[]
>undefined : undefined
>null : null
>undefined : undefined

var temp4 = [];
>temp4 : any[]
>[] : undefined[]

interface myArray extends Array<Number> { }
>myArray : myArray
>Array : T[]
>Number : Number

interface myArray2 extends Array<Number|String> { }
>myArray2 : myArray2
>Array : T[]
>Number : Number
>String : String

var d0 = [1, true, ...temp,];  // has type (string|number|boolean)[]
>d0 : (number | boolean | string)[]
>[1, true, ...temp,] : (number | boolean | string)[]
>1 : number
>true : boolean
>...temp : string
>temp : string[]

var d1 = [...temp];            // has type string[]
>d1 : string[]
>[...temp] : string[]
>...temp : string
>temp : string[]

var d2: number[] = [...temp1];
>d2 : number[]
>[...temp1] : number[]
>...temp1 : number
>temp1 : number[]

var d3: myArray = [...temp1];
>d3 : myArray
>myArray : myArray
>[...temp1] : number[]
>...temp1 : number
>temp1 : number[]

var d4: myArray2 = [...temp, ...temp1];
>d4 : myArray2
>myArray2 : myArray2
>[...temp, ...temp1] : (string | number)[]
>...temp : string
>temp : string[]
>...temp1 : number
>temp1 : number[]

var d5 = [...temp3];
>d5 : any[]
>[...temp3] : any[]
>...temp3 : any
>temp3 : any[]

var d6 = [...temp4];
>d6 : any[]
>[...temp4] : any[]
>...temp4 : any
>temp4 : any[]

var d7 = [...[...temp1]];
>d7 : number[]
>[...[...temp1]] : number[]
>...[...temp1] : number
>[...temp1] : number[]
>...temp1 : number
>temp1 : number[]

var d8: number[][] = [[...temp1]]
>d8 : number[][]
>[[...temp1]] : number[][]
>[...temp1] : number[]
>...temp1 : number
>temp1 : number[]

var d9 = [[...temp1], ...["hello"]];
>d9 : (number[] | string)[]
>[[...temp1], ...["hello"]] : (number[] | string)[]
>[...temp1] : number[]
>...temp1 : number
>temp1 : number[]
>...["hello"] : string
>["hello"] : string[]
>"hello" : string

