{ "type": "Program", "statements": [ { "type": "TSDeclareFunction", "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": "Identifier", "name": "a", "typeAnnotation": { "type": "TSTypeLiteral", "members": [ { "type": "TSPropertySignature", "computed": false, "optional": false, "readonly": false, "key": { "type": "Identifier", "name": "x", "decorators": [], "loc": { "start": { "line": 17, "column": 19 }, "end": { "line": 17, "column": 20 } } }, "typeAnnotation": { "type": "TSNumberKeyword", "loc": { "start": { "line": 17, "column": 22 }, "end": { "line": 17, "column": 28 } } }, "loc": { "start": { "line": 17, "column": 19 }, "end": { "line": 17, "column": 29 } } }, { "type": "TSPropertySignature", "computed": false, "optional": false, "readonly": false, "key": { "type": "Identifier", "name": "y", "decorators": [], "loc": { "start": { "line": 17, "column": 30 }, "end": { "line": 17, "column": 31 } } }, "typeAnnotation": { "type": "TSStringKeyword", "loc": { "start": { "line": 17, "column": 33 }, "end": { "line": 17, "column": 39 } } }, "loc": { "start": { "line": 17, "column": 30 }, "end": { "line": 17, "column": 41 } } } ], "loc": { "start": { "line": 17, "column": 17 }, "end": { "line": 17, "column": 41 } } }, "decorators": [], "loc": { "start": { "line": 17, "column": 14 }, "end": { "line": 17, "column": 15 } } } ], "returnType": { "type": "TSNumberKeyword", "loc": { "start": { "line": 17, "column": 44 }, "end": { "line": 17, "column": 50 } } }, "loc": { "start": { "line": 17, "column": 1 }, "end": { "line": 17, "column": 51 } } }, "loc": { "start": { "line": 17, "column": 1 }, "end": { "line": 17, "column": 51 } } }, { "type": "TSDeclareFunction", "function": { "type": "ScriptFunction", "id": { "type": "Identifier", "name": "foo", "decorators": [], "loc": { "start": { "line": 18, "column": 10 }, "end": { "line": 18, "column": 13 } } }, "generator": false, "async": false, "expression": false, "params": [ { "type": "Identifier", "name": "a", "typeAnnotation": { "type": "TSTypeLiteral", "members": [ { "type": "TSPropertySignature", "computed": false, "optional": false, "readonly": false, "key": { "type": "Identifier", "name": "x", "decorators": [], "loc": { "start": { "line": 18, "column": 19 }, "end": { "line": 18, "column": 20 } } }, "typeAnnotation": { "type": "TSStringKeyword", "loc": { "start": { "line": 18, "column": 22 }, "end": { "line": 18, "column": 28 } } }, "loc": { "start": { "line": 18, "column": 19 }, "end": { "line": 18, "column": 29 } } }, { "type": "TSPropertySignature", "computed": false, "optional": false, "readonly": false, "key": { "type": "Identifier", "name": "y", "decorators": [], "loc": { "start": { "line": 18, "column": 30 }, "end": { "line": 18, "column": 31 } } }, "typeAnnotation": { "type": "TSNumberKeyword", "loc": { "start": { "line": 18, "column": 33 }, "end": { "line": 18, "column": 39 } } }, "loc": { "start": { "line": 18, "column": 30 }, "end": { "line": 18, "column": 41 } } } ], "loc": { "start": { "line": 18, "column": 17 }, "end": { "line": 18, "column": 41 } } }, "decorators": [], "loc": { "start": { "line": 18, "column": 14 }, "end": { "line": 18, "column": 15 } } } ], "returnType": { "type": "TSNumberKeyword", "loc": { "start": { "line": 18, "column": 44 }, "end": { "line": 18, "column": 50 } } }, "loc": { "start": { "line": 18, "column": 1 }, "end": { "line": 18, "column": 51 } } }, "loc": { "start": { "line": 18, "column": 1 }, "end": { "line": 18, "column": 51 } } }, { "type": "FunctionDeclaration", "function": { "type": "ScriptFunction", "id": { "type": "Identifier", "name": "foo", "decorators": [], "loc": { "start": { "line": 19, "column": 10 }, "end": { "line": 19, "column": 13 } } }, "generator": false, "async": false, "expression": false, "params": [ { "type": "Identifier", "name": "a", "typeAnnotation": { "type": "TSTypeLiteral", "members": [ { "type": "TSPropertySignature", "computed": false, "optional": false, "readonly": false, "key": { "type": "Identifier", "name": "x", "decorators": [], "loc": { "start": { "line": 19, "column": 19 }, "end": { "line": 19, "column": 20 } } }, "typeAnnotation": { "type": "TSUnionType", "types": [ { "type": "TSNumberKeyword", "loc": { "start": { "line": 19, "column": 22 }, "end": { "line": 19, "column": 28 } } }, { "type": "TSStringKeyword", "loc": { "start": { "line": 19, "column": 31 }, "end": { "line": 19, "column": 37 } } } ], "loc": { "start": { "line": 19, "column": 22 }, "end": { "line": 19, "column": 37 } } }, "loc": { "start": { "line": 19, "column": 19 }, "end": { "line": 19, "column": 39 } } } ], "loc": { "start": { "line": 19, "column": 17 }, "end": { "line": 19, "column": 39 } } }, "decorators": [], "loc": { "start": { "line": 19, "column": 14 }, "end": { "line": 19, "column": 15 } } } ], "body": { "type": "BlockStatement", "statements": [ { "type": "ReturnStatement", "argument": { "type": "NumberLiteral", "value": 2, "loc": { "start": { "line": 20, "column": 12 }, "end": { "line": 20, "column": 13 } } }, "loc": { "start": { "line": 20, "column": 5 }, "end": { "line": 20, "column": 14 } } } ], "loc": { "start": { "line": 19, "column": 41 }, "end": { "line": 21, "column": 2 } } }, "loc": { "start": { "line": 19, "column": 1 }, "end": { "line": 21, "column": 2 } } }, "loc": { "start": { "line": 19, "column": 1 }, "end": { "line": 21, "column": 2 } } }, { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "foo", "decorators": [], "loc": { "start": { "line": 23, "column": 1 }, "end": { "line": 23, "column": 4 } } }, "arguments": [ { "type": "ObjectExpression", "properties": [ { "type": "Property", "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "name": "x", "decorators": [], "loc": { "start": { "line": 23, "column": 7 }, "end": { "line": 23, "column": 8 } } }, "value": { "type": "BooleanLiteral", "value": true, "loc": { "start": { "line": 23, "column": 10 }, "end": { "line": 23, "column": 14 } } }, "kind": "init", "loc": { "start": { "line": 23, "column": 7 }, "end": { "line": 23, "column": 14 } } } ], "loc": { "start": { "line": 23, "column": 5 }, "end": { "line": 23, "column": 16 } } } ], "optional": false, "loc": { "start": { "line": 23, "column": 1 }, "end": { "line": 23, "column": 17 } } }, "loc": { "start": { "line": 23, "column": 1 }, "end": { "line": 23, "column": 18 } } } ], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 23, "column": 18 } } } TypeError: No overload matches this call. [functionOverload1.ts:23:1]