{ "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": "ObjectPattern", "properties": [ { "type": "Property", "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "name": "x", "decorators": [], "loc": { "start": { "line": 17, "column": 16 }, "end": { "line": 17, "column": 17 } } }, "value": { "type": "ObjectPattern", "properties": [ { "type": "Property", "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "name": "asd", "decorators": [], "loc": { "start": { "line": 17, "column": 21 }, "end": { "line": 17, "column": 24 } } }, "value": { "type": "Identifier", "name": "asd", "decorators": [], "loc": { "start": { "line": 17, "column": 21 }, "end": { "line": 17, "column": 24 } } }, "kind": "init", "loc": { "start": { "line": 17, "column": 21 }, "end": { "line": 17, "column": 24 } } } ], "loc": { "start": { "line": 17, "column": 19 }, "end": { "line": 17, "column": 26 } } }, "kind": "init", "loc": { "start": { "line": 17, "column": 16 }, "end": { "line": 17, "column": 26 } } }, { "type": "Property", "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "name": "y", "decorators": [], "loc": { "start": { "line": 17, "column": 28 }, "end": { "line": 17, "column": 29 } } }, "value": { "type": "AssignmentPattern", "left": { "type": "ObjectPattern", "properties": [ { "type": "Property", "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "name": "t", "decorators": [], "loc": { "start": { "line": 17, "column": 33 }, "end": { "line": 17, "column": 34 } } }, "value": { "type": "AssignmentPattern", "left": { "type": "Identifier", "name": "t", "decorators": [], "loc": { "start": { "line": 17, "column": 33 }, "end": { "line": 17, "column": 34 } } }, "right": { "type": "NumberLiteral", "value": 6, "loc": { "start": { "line": 17, "column": 37 }, "end": { "line": 17, "column": 38 } } }, "loc": { "start": { "line": 17, "column": 33 }, "end": { "line": 17, "column": 38 } } }, "kind": "init", "loc": { "start": { "line": 17, "column": 33 }, "end": { "line": 17, "column": 38 } } }, { "type": "Property", "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "name": "r", "decorators": [], "loc": { "start": { "line": 17, "column": 40 }, "end": { "line": 17, "column": 41 } } }, "value": { "type": "AssignmentPattern", "left": { "type": "Identifier", "name": "r", "decorators": [], "loc": { "start": { "line": 17, "column": 40 }, "end": { "line": 17, "column": 41 } } }, "right": { "type": "StringLiteral", "value": "foo", "loc": { "start": { "line": 17, "column": 44 }, "end": { "line": 17, "column": 49 } } }, "loc": { "start": { "line": 17, "column": 40 }, "end": { "line": 17, "column": 49 } } }, "kind": "init", "loc": { "start": { "line": 17, "column": 40 }, "end": { "line": 17, "column": 49 } } } ], "loc": { "start": { "line": 17, "column": 31 }, "end": { "line": 17, "column": 51 } } }, "right": { "type": "ObjectExpression", "properties": [ { "type": "Property", "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "name": "t", "decorators": [], "loc": { "start": { "line": 17, "column": 56 }, "end": { "line": 17, "column": 57 } } }, "value": { "type": "StringLiteral", "value": "foo", "loc": { "start": { "line": 17, "column": 59 }, "end": { "line": 17, "column": 64 } } }, "kind": "init", "loc": { "start": { "line": 17, "column": 56 }, "end": { "line": 17, "column": 64 } } } ], "loc": { "start": { "line": 17, "column": 54 }, "end": { "line": 17, "column": 66 } } }, "loc": { "start": { "line": 17, "column": 31 }, "end": { "line": 17, "column": 66 } } }, "kind": "init", "loc": { "start": { "line": 17, "column": 28 }, "end": { "line": 17, "column": 66 } } } ], "loc": { "start": { "line": 17, "column": 14 }, "end": { "line": 17, "column": 68 } } } ], "body": { "type": "BlockStatement", "statements": [], "loc": { "start": { "line": 17, "column": 70 }, "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: { asd }, y: { t, r } }: { x?: { asd: any; }; y?: { t: string; }; }) => void and number [functionWithPattern3.ts:21:1]