{ "type": "Program", "statements": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "ArrayPattern", "elements": [ { "type": "AssignmentPattern", "left": { "type": "Identifier", "name": "a", "decorators": [], "loc": { "start": { "line": 17, "column": 6 }, "end": { "line": 17, "column": 7 } } }, "right": { "type": "NumberLiteral", "value": 5, "loc": { "start": { "line": 17, "column": 10 }, "end": { "line": 17, "column": 11 } } }, "loc": { "start": { "line": 17, "column": 6 }, "end": { "line": 17, "column": 11 } } }, { "type": "RestElement", "argument": { "type": "Identifier", "name": "b", "decorators": [], "loc": { "start": { "line": 17, "column": 16 }, "end": { "line": 17, "column": 17 } } }, "loc": { "start": { "line": 17, "column": 13 }, "end": { "line": 17, "column": 17 } } } ], "typeAnnotation": { "type": "TSUnionType", "types": [ { "type": "TSTupleType", "elementTypes": [ { "type": "TSNumberKeyword", "loc": { "start": { "line": 17, "column": 21 }, "end": { "line": 17, "column": 28 } } }, { "type": "TSStringKeyword", "loc": { "start": { "line": 17, "column": 29 }, "end": { "line": 17, "column": 36 } } }, { "type": "TSBooleanKeyword", "loc": { "start": { "line": 17, "column": 37 }, "end": { "line": 17, "column": 45 } } } ], "loc": { "start": { "line": 17, "column": 20 }, "end": { "line": 17, "column": 45 } } }, { "type": "TSArrayType", "elementType": { "type": "TSStringKeyword", "loc": { "start": { "line": 17, "column": 48 }, "end": { "line": 17, "column": 54 } } }, "loc": { "start": { "line": 17, "column": 48 }, "end": { "line": 17, "column": 56 } } }, { "type": "TSNumberKeyword", "loc": { "start": { "line": 17, "column": 59 }, "end": { "line": 17, "column": 65 } } } ], "loc": { "start": { "line": 17, "column": 20 }, "end": { "line": 17, "column": 65 } } }, "loc": { "start": { "line": 17, "column": 5 }, "end": { "line": 17, "column": 18 } } }, "init": { "type": "ArrayExpression", "elements": [ { "type": "StringLiteral", "value": "foo", "loc": { "start": { "line": 17, "column": 69 }, "end": { "line": 17, "column": 74 } } }, { "type": "StringLiteral", "value": "bar", "loc": { "start": { "line": 17, "column": 76 }, "end": { "line": 17, "column": 81 } } } ], "loc": { "start": { "line": 17, "column": 68 }, "end": { "line": 17, "column": 82 } } }, "loc": { "start": { "line": 17, "column": 5 }, "end": { "line": 17, "column": 82 } } } ], "kind": "var", "loc": { "start": { "line": 17, "column": 1 }, "end": { "line": 17, "column": 83 } } } ], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 18, "column": 1 } } } TypeError: Type [number, string, boolean] | string[] | number must have a '[Symbol.iterator]()' method that returns an iterator. [arrayDestructuring12.ts:17:5]