{ "type": "Program", "statements": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "ArrayPattern", "elements": [ { "type": "Identifier", "name": "a", "decorators": [], "loc": { "start": { "line": 17, "column": 6 }, "end": { "line": 17, "column": 7 } } }, { "type": "Identifier", "name": "b", "decorators": [], "loc": { "start": { "line": 17, "column": 9 }, "end": { "line": 17, "column": 10 } } } ], "typeAnnotation": { "type": "TSUnionType", "types": [ { "type": "TSArrayType", "elementType": { "type": "TSNumberKeyword", "loc": { "start": { "line": 17, "column": 13 }, "end": { "line": 17, "column": 19 } } }, "loc": { "start": { "line": 17, "column": 13 }, "end": { "line": 17, "column": 21 } } }, { "type": "TSTupleType", "elementTypes": [ { "type": "TSStringKeyword", "loc": { "start": { "line": 17, "column": 25 }, "end": { "line": 17, "column": 32 } } }, { "type": "TSNumberKeyword", "loc": { "start": { "line": 17, "column": 33 }, "end": { "line": 17, "column": 40 } } } ], "loc": { "start": { "line": 17, "column": 24 }, "end": { "line": 17, "column": 40 } } } ], "loc": { "start": { "line": 17, "column": 13 }, "end": { "line": 17, "column": 40 } } }, "loc": { "start": { "line": 17, "column": 5 }, "end": { "line": 17, "column": 11 } } }, "init": { "type": "ArrayExpression", "elements": [ { "type": "NumberLiteral", "value": 1, "loc": { "start": { "line": 17, "column": 44 }, "end": { "line": 17, "column": 45 } } }, { "type": "NumberLiteral", "value": 2, "loc": { "start": { "line": 17, "column": 47 }, "end": { "line": 17, "column": 48 } } } ], "loc": { "start": { "line": 17, "column": 43 }, "end": { "line": 17, "column": 49 } } }, "loc": { "start": { "line": 17, "column": 5 }, "end": { "line": 17, "column": 49 } } } ], "kind": "var", "loc": { "start": { "line": 17, "column": 1 }, "end": { "line": 17, "column": 50 } } }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "Identifier", "name": "a", "decorators": [], "loc": { "start": { "line": 18, "column": 1 }, "end": { "line": 18, "column": 2 } } }, "right": { "type": "ObjectExpression", "properties": [], "loc": { "start": { "line": 18, "column": 5 }, "end": { "line": 18, "column": 7 } } }, "loc": { "start": { "line": 18, "column": 1 }, "end": { "line": 18, "column": 7 } } }, "loc": { "start": { "line": 18, "column": 1 }, "end": { "line": 18, "column": 8 } } } ], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 18, "column": 8 } } } TypeError: Type '{ }' is not assignable to type 'number | string'. [arrayDestructuring6.ts:18:1]