{ "type": "Program", "statements": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "a", "decorators": [], "loc": { "start": { "line": 17, "column": 5 }, "end": { "line": 17, "column": 6 } } }, "init": { "type": "ObjectExpression", "properties": [], "loc": { "start": { "line": 17, "column": 9 }, "end": { "line": 17, "column": 11 } } }, "loc": { "start": { "line": 17, "column": 5 }, "end": { "line": 17, "column": 11 } } } ], "kind": "var", "loc": { "start": { "line": 17, "column": 1 }, "end": { "line": 17, "column": 12 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "b", "typeAnnotation": { "type": "TSNumberKeyword", "loc": { "start": { "line": 18, "column": 8 }, "end": { "line": 18, "column": 14 } } }, "decorators": [], "loc": { "start": { "line": 18, "column": 5 }, "end": { "line": 18, "column": 6 } } }, "init": null, "loc": { "start": { "line": 18, "column": 5 }, "end": { "line": 18, "column": 6 } } } ], "kind": "var", "loc": { "start": { "line": 18, "column": 1 }, "end": { "line": 18, "column": 15 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "c", "typeAnnotation": { "type": "TSStringKeyword", "loc": { "start": { "line": 19, "column": 7 }, "end": { "line": 19, "column": 13 } } }, "decorators": [], "loc": { "start": { "line": 19, "column": 5 }, "end": { "line": 19, "column": 6 } } }, "init": null, "loc": { "start": { "line": 19, "column": 5 }, "end": { "line": 19, "column": 6 } } } ], "kind": "var", "loc": { "start": { "line": 19, "column": 1 }, "end": { "line": 19, "column": 14 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "d", "decorators": [], "loc": { "start": { "line": 20, "column": 5 }, "end": { "line": 20, "column": 6 } } }, "init": { "type": "ArrayExpression", "elements": [], "loc": { "start": { "line": 20, "column": 9 }, "end": { "line": 20, "column": 11 } } }, "loc": { "start": { "line": 20, "column": 5 }, "end": { "line": 20, "column": 11 } } } ], "kind": "var", "loc": { "start": { "line": 20, "column": 1 }, "end": { "line": 20, "column": 12 } } }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "ArrayPattern", "elements": [ { "type": "Identifier", "name": "a", "decorators": [], "loc": { "start": { "line": 21, "column": 2 }, "end": { "line": 21, "column": 3 } } }, { "type": "AssignmentPattern", "left": { "type": "ArrayPattern", "elements": [ { "type": "Identifier", "name": "b", "decorators": [], "loc": { "start": { "line": 21, "column": 6 }, "end": { "line": 21, "column": 7 } } }, { "type": "OmittedExpression", "loc": { "start": { "line": 21, "column": 9 }, "end": { "line": 21, "column": 10 } } }, { "type": "AssignmentPattern", "left": { "type": "Identifier", "name": "c", "decorators": [], "loc": { "start": { "line": 21, "column": 11 }, "end": { "line": 21, "column": 12 } } }, "right": { "type": "StringLiteral", "value": "bar", "loc": { "start": { "line": 21, "column": 15 }, "end": { "line": 21, "column": 20 } } }, "loc": { "start": { "line": 21, "column": 11 }, "end": { "line": 21, "column": 20 } } } ], "loc": { "start": { "line": 21, "column": 5 }, "end": { "line": 21, "column": 21 } } }, "right": { "type": "ArrayExpression", "elements": [ { "type": "StringLiteral", "value": "foo", "loc": { "start": { "line": 21, "column": 25 }, "end": { "line": 21, "column": 30 } } }, { "type": "NumberLiteral", "value": 5, "loc": { "start": { "line": 21, "column": 32 }, "end": { "line": 21, "column": 33 } } } ], "loc": { "start": { "line": 21, "column": 24 }, "end": { "line": 21, "column": 34 } } }, "loc": { "start": { "line": 21, "column": 5 }, "end": { "line": 21, "column": 34 } } }, { "type": "RestElement", "argument": { "type": "Identifier", "name": "d", "decorators": [], "loc": { "start": { "line": 21, "column": 39 }, "end": { "line": 21, "column": 40 } } }, "loc": { "start": { "line": 21, "column": 36 }, "end": { "line": 21, "column": 40 } } } ], "loc": { "start": { "line": 21, "column": 1 }, "end": { "line": 21, "column": 41 } } }, "right": { "type": "ArrayExpression", "elements": [ { "type": "ObjectExpression", "properties": [], "loc": { "start": { "line": 21, "column": 45 }, "end": { "line": 21, "column": 47 } } }, { "type": "ArrayExpression", "elements": [ { "type": "NumberLiteral", "value": 42, "loc": { "start": { "line": 21, "column": 50 }, "end": { "line": 21, "column": 52 } } }, { "type": "OmittedExpression", "loc": { "start": { "line": 21, "column": 54 }, "end": { "line": 21, "column": 55 } } }, { "type": "BinaryExpression", "operator": "+", "left": { "type": "StringLiteral", "value": "foo", "loc": { "start": { "line": 21, "column": 56 }, "end": { "line": 21, "column": 61 } } }, "right": { "type": "NumberLiteral", "value": 2, "loc": { "start": { "line": 21, "column": 64 }, "end": { "line": 21, "column": 65 } } }, "loc": { "start": { "line": 21, "column": 56 }, "end": { "line": 21, "column": 65 } } } ], "loc": { "start": { "line": 21, "column": 49 }, "end": { "line": 21, "column": 66 } } } ], "loc": { "start": { "line": 21, "column": 44 }, "end": { "line": 21, "column": 67 } } }, "loc": { "start": { "line": 21, "column": 1 }, "end": { "line": 21, "column": 67 } } }, "loc": { "start": { "line": 21, "column": 1 }, "end": { "line": 21, "column": 68 } } } ], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 21, "column": 68 } } } TypeError: Type 'number | string' is not assignable to type 'number'. [arrayDestructuring37.ts:21:6]