{ "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": "ObjectPattern", "properties": [ { "type": "Property", "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "name": "x", "decorators": [], "loc": { "start": { "line": 17, "column": 16 }, "end": { "line": 17, "column": 17 } } }, "value": { "type": "AssignmentPattern", "left": { "type": "Identifier", "name": "x", "decorators": [], "loc": { "start": { "line": 17, "column": 16 }, "end": { "line": 17, "column": 17 } } }, "right": { "type": "NumberLiteral", "value": 6, "loc": { "start": { "line": 17, "column": 20 }, "end": { "line": 17, "column": 21 } } }, "loc": { "start": { "line": 17, "column": 16 }, "end": { "line": 17, "column": 21 } } }, "kind": "init", "loc": { "start": { "line": 17, "column": 16 }, "end": { "line": 17, "column": 21 } } }, { "type": "Property", "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "name": "y", "decorators": [], "loc": { "start": { "line": 17, "column": 23 }, "end": { "line": 17, "column": 24 } } }, "value": { "type": "AssignmentPattern", "left": { "type": "Identifier", "name": "y", "decorators": [], "loc": { "start": { "line": 17, "column": 23 }, "end": { "line": 17, "column": 24 } } }, "right": { "type": "StringLiteral", "value": "foo", "loc": { "start": { "line": 17, "column": 27 }, "end": { "line": 17, "column": 32 } } }, "loc": { "start": { "line": 17, "column": 23 }, "end": { "line": 17, "column": 32 } } }, "kind": "init", "loc": { "start": { "line": 17, "column": 23 }, "end": { "line": 17, "column": 32 } } } ], "loc": { "start": { "line": 17, "column": 14 }, "end": { "line": 17, "column": 34 } } }, "right": { "type": "ObjectExpression", "properties": [ { "type": "Property", "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "name": "x", "decorators": [], "loc": { "start": { "line": 17, "column": 39 }, "end": { "line": 17, "column": 40 } } }, "value": { "type": "StringLiteral", "value": "foo", "loc": { "start": { "line": 17, "column": 42 }, "end": { "line": 17, "column": 47 } } }, "kind": "init", "loc": { "start": { "line": 17, "column": 39 }, "end": { "line": 17, "column": 47 } } } ], "loc": { "start": { "line": 17, "column": 37 }, "end": { "line": 17, "column": 49 } } }, "loc": { "start": { "line": 17, "column": 14 }, "end": { "line": 17, "column": 49 } } } ], "body": { "type": "BlockStatement", "statements": [], "loc": { "start": { "line": 17, "column": 51 }, "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 }?: { x?: string; y?: string; }) => void and number [functionWithPattern2.ts:21:1]