{ "type": "Program", "statements": [ { "type": "FunctionDeclaration", "function": { "type": "ScriptFunction", "id": { "type": "Identifier", "name": "foo", "decorators": [], "loc": { "start": { "line": 17, "column": 10 }, "end": { "line": 17, "column": 13 } } }, "generator": false, "async": false, "expression": false, "params": [ { "type": "AssignmentPattern", "left": { "type": "ArrayPattern", "elements": [ { "type": "ObjectPattern", "properties": [ { "type": "Property", "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "name": "x", "decorators": [], "loc": { "start": { "line": 17, "column": 17 }, "end": { "line": 17, "column": 18 } } }, "value": { "type": "AssignmentPattern", "left": { "type": "Identifier", "name": "x", "decorators": [], "loc": { "start": { "line": 17, "column": 17 }, "end": { "line": 17, "column": 18 } } }, "right": { "type": "NumberLiteral", "value": 6, "loc": { "start": { "line": 17, "column": 21 }, "end": { "line": 17, "column": 22 } } }, "loc": { "start": { "line": 17, "column": 17 }, "end": { "line": 17, "column": 22 } } }, "kind": "init", "loc": { "start": { "line": 17, "column": 17 }, "end": { "line": 17, "column": 22 } } } ], "loc": { "start": { "line": 17, "column": 15 }, "end": { "line": 17, "column": 24 } } }, { "type": "AssignmentPattern", "left": { "type": "Identifier", "name": "y", "decorators": [], "loc": { "start": { "line": 17, "column": 26 }, "end": { "line": 17, "column": 27 } } }, "right": { "type": "StringLiteral", "value": "foo", "loc": { "start": { "line": 17, "column": 30 }, "end": { "line": 17, "column": 35 } } }, "loc": { "start": { "line": 17, "column": 26 }, "end": { "line": 17, "column": 35 } } }, { "type": "Identifier", "name": "z", "decorators": [], "loc": { "start": { "line": 17, "column": 37 }, "end": { "line": 17, "column": 38 } } } ], "loc": { "start": { "line": 17, "column": 14 }, "end": { "line": 17, "column": 39 } } }, "right": { "type": "ArrayExpression", "elements": [ { "type": "ObjectExpression", "properties": [ { "type": "Property", "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "name": "x", "decorators": [], "loc": { "start": { "line": 17, "column": 45 }, "end": { "line": 17, "column": 46 } } }, "value": { "type": "StringLiteral", "value": "foo", "loc": { "start": { "line": 17, "column": 48 }, "end": { "line": 17, "column": 53 } } }, "kind": "init", "loc": { "start": { "line": 17, "column": 45 }, "end": { "line": 17, "column": 53 } } } ], "loc": { "start": { "line": 17, "column": 43 }, "end": { "line": 17, "column": 55 } } }, { "type": "NumberLiteral", "value": 2, "loc": { "start": { "line": 17, "column": 57 }, "end": { "line": 17, "column": 58 } } }, { "type": "NumberLiteral", "value": 3, "loc": { "start": { "line": 17, "column": 60 }, "end": { "line": 17, "column": 61 } } } ], "loc": { "start": { "line": 17, "column": 42 }, "end": { "line": 17, "column": 62 } } }, "loc": { "start": { "line": 17, "column": 14 }, "end": { "line": 17, "column": 62 } } } ], "body": { "type": "BlockStatement", "statements": [], "loc": { "start": { "line": 17, "column": 64 }, "end": { "line": 19, "column": 2 } } }, "loc": { "start": { "line": 17, "column": 1 }, "end": { "line": 19, "column": 2 } } }, "loc": { "start": { "line": 17, "column": 1 }, "end": { "line": 19, "column": 2 } } }, { "type": "ExpressionStatement", "expression": { "type": "BinaryExpression", "operator": "+", "left": { "type": "Identifier", "name": "foo", "decorators": [], "loc": { "start": { "line": 21, "column": 1 }, "end": { "line": 21, "column": 4 } } }, "right": { "type": "NumberLiteral", "value": 5, "loc": { "start": { "line": 21, "column": 7 }, "end": { "line": 21, "column": 8 } } }, "loc": { "start": { "line": 21, "column": 1 }, "end": { "line": 21, "column": 8 } } }, "loc": { "start": { "line": 21, "column": 1 }, "end": { "line": 21, "column": 9 } } } ], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 21, "column": 9 } } } TypeError: operator + cannot be applied to types ([{ x }, y, z]?: [{ x: string; }, number, number]) => void and number [functionWithPattern1.ts:21:1]