1{ 2 "type": "Program", 3 "statements": [ 4 { 5 "type": "TSDeclareFunction", 6 "function": { 7 "type": "ScriptFunction", 8 "id": { 9 "type": "Identifier", 10 "name": "foo", 11 "decorators": [], 12 "loc": { 13 "start": { 14 "line": 17, 15 "column": 10 16 }, 17 "end": { 18 "line": 17, 19 "column": 13 20 } 21 } 22 }, 23 "generator": false, 24 "async": false, 25 "expression": false, 26 "params": [ 27 { 28 "type": "Identifier", 29 "name": "a", 30 "typeAnnotation": { 31 "type": "TSTypeLiteral", 32 "members": [ 33 { 34 "type": "TSPropertySignature", 35 "computed": false, 36 "optional": false, 37 "readonly": false, 38 "key": { 39 "type": "Identifier", 40 "name": "x", 41 "decorators": [], 42 "loc": { 43 "start": { 44 "line": 17, 45 "column": 19 46 }, 47 "end": { 48 "line": 17, 49 "column": 20 50 } 51 } 52 }, 53 "typeAnnotation": { 54 "type": "TSNumberKeyword", 55 "loc": { 56 "start": { 57 "line": 17, 58 "column": 22 59 }, 60 "end": { 61 "line": 17, 62 "column": 28 63 } 64 } 65 }, 66 "loc": { 67 "start": { 68 "line": 17, 69 "column": 19 70 }, 71 "end": { 72 "line": 17, 73 "column": 29 74 } 75 } 76 }, 77 { 78 "type": "TSPropertySignature", 79 "computed": false, 80 "optional": false, 81 "readonly": false, 82 "key": { 83 "type": "Identifier", 84 "name": "y", 85 "decorators": [], 86 "loc": { 87 "start": { 88 "line": 17, 89 "column": 30 90 }, 91 "end": { 92 "line": 17, 93 "column": 31 94 } 95 } 96 }, 97 "typeAnnotation": { 98 "type": "TSStringKeyword", 99 "loc": { 100 "start": { 101 "line": 17, 102 "column": 33 103 }, 104 "end": { 105 "line": 17, 106 "column": 39 107 } 108 } 109 }, 110 "loc": { 111 "start": { 112 "line": 17, 113 "column": 30 114 }, 115 "end": { 116 "line": 17, 117 "column": 41 118 } 119 } 120 } 121 ], 122 "loc": { 123 "start": { 124 "line": 17, 125 "column": 17 126 }, 127 "end": { 128 "line": 17, 129 "column": 41 130 } 131 } 132 }, 133 "decorators": [], 134 "loc": { 135 "start": { 136 "line": 17, 137 "column": 14 138 }, 139 "end": { 140 "line": 17, 141 "column": 15 142 } 143 } 144 } 145 ], 146 "returnType": { 147 "type": "TSNumberKeyword", 148 "loc": { 149 "start": { 150 "line": 17, 151 "column": 44 152 }, 153 "end": { 154 "line": 17, 155 "column": 50 156 } 157 } 158 }, 159 "loc": { 160 "start": { 161 "line": 17, 162 "column": 1 163 }, 164 "end": { 165 "line": 17, 166 "column": 51 167 } 168 } 169 }, 170 "loc": { 171 "start": { 172 "line": 17, 173 "column": 1 174 }, 175 "end": { 176 "line": 17, 177 "column": 51 178 } 179 } 180 }, 181 { 182 "type": "TSDeclareFunction", 183 "function": { 184 "type": "ScriptFunction", 185 "id": { 186 "type": "Identifier", 187 "name": "foo", 188 "decorators": [], 189 "loc": { 190 "start": { 191 "line": 18, 192 "column": 10 193 }, 194 "end": { 195 "line": 18, 196 "column": 13 197 } 198 } 199 }, 200 "generator": false, 201 "async": false, 202 "expression": false, 203 "params": [ 204 { 205 "type": "Identifier", 206 "name": "a", 207 "typeAnnotation": { 208 "type": "TSTypeLiteral", 209 "members": [ 210 { 211 "type": "TSPropertySignature", 212 "computed": false, 213 "optional": false, 214 "readonly": false, 215 "key": { 216 "type": "Identifier", 217 "name": "x", 218 "decorators": [], 219 "loc": { 220 "start": { 221 "line": 18, 222 "column": 19 223 }, 224 "end": { 225 "line": 18, 226 "column": 20 227 } 228 } 229 }, 230 "typeAnnotation": { 231 "type": "TSStringKeyword", 232 "loc": { 233 "start": { 234 "line": 18, 235 "column": 22 236 }, 237 "end": { 238 "line": 18, 239 "column": 28 240 } 241 } 242 }, 243 "loc": { 244 "start": { 245 "line": 18, 246 "column": 19 247 }, 248 "end": { 249 "line": 18, 250 "column": 29 251 } 252 } 253 }, 254 { 255 "type": "TSPropertySignature", 256 "computed": false, 257 "optional": false, 258 "readonly": false, 259 "key": { 260 "type": "Identifier", 261 "name": "y", 262 "decorators": [], 263 "loc": { 264 "start": { 265 "line": 18, 266 "column": 30 267 }, 268 "end": { 269 "line": 18, 270 "column": 31 271 } 272 } 273 }, 274 "typeAnnotation": { 275 "type": "TSNumberKeyword", 276 "loc": { 277 "start": { 278 "line": 18, 279 "column": 33 280 }, 281 "end": { 282 "line": 18, 283 "column": 39 284 } 285 } 286 }, 287 "loc": { 288 "start": { 289 "line": 18, 290 "column": 30 291 }, 292 "end": { 293 "line": 18, 294 "column": 41 295 } 296 } 297 } 298 ], 299 "loc": { 300 "start": { 301 "line": 18, 302 "column": 17 303 }, 304 "end": { 305 "line": 18, 306 "column": 41 307 } 308 } 309 }, 310 "decorators": [], 311 "loc": { 312 "start": { 313 "line": 18, 314 "column": 14 315 }, 316 "end": { 317 "line": 18, 318 "column": 15 319 } 320 } 321 } 322 ], 323 "returnType": { 324 "type": "TSNumberKeyword", 325 "loc": { 326 "start": { 327 "line": 18, 328 "column": 44 329 }, 330 "end": { 331 "line": 18, 332 "column": 50 333 } 334 } 335 }, 336 "loc": { 337 "start": { 338 "line": 18, 339 "column": 1 340 }, 341 "end": { 342 "line": 18, 343 "column": 51 344 } 345 } 346 }, 347 "loc": { 348 "start": { 349 "line": 18, 350 "column": 1 351 }, 352 "end": { 353 "line": 18, 354 "column": 51 355 } 356 } 357 }, 358 { 359 "type": "FunctionDeclaration", 360 "function": { 361 "type": "ScriptFunction", 362 "id": { 363 "type": "Identifier", 364 "name": "foo", 365 "decorators": [], 366 "loc": { 367 "start": { 368 "line": 19, 369 "column": 10 370 }, 371 "end": { 372 "line": 19, 373 "column": 13 374 } 375 } 376 }, 377 "generator": false, 378 "async": false, 379 "expression": false, 380 "params": [ 381 { 382 "type": "Identifier", 383 "name": "a", 384 "typeAnnotation": { 385 "type": "TSTypeLiteral", 386 "members": [ 387 { 388 "type": "TSPropertySignature", 389 "computed": false, 390 "optional": false, 391 "readonly": false, 392 "key": { 393 "type": "Identifier", 394 "name": "x", 395 "decorators": [], 396 "loc": { 397 "start": { 398 "line": 19, 399 "column": 19 400 }, 401 "end": { 402 "line": 19, 403 "column": 20 404 } 405 } 406 }, 407 "typeAnnotation": { 408 "type": "TSUnionType", 409 "types": [ 410 { 411 "type": "TSNumberKeyword", 412 "loc": { 413 "start": { 414 "line": 19, 415 "column": 22 416 }, 417 "end": { 418 "line": 19, 419 "column": 28 420 } 421 } 422 }, 423 { 424 "type": "TSStringKeyword", 425 "loc": { 426 "start": { 427 "line": 19, 428 "column": 31 429 }, 430 "end": { 431 "line": 19, 432 "column": 37 433 } 434 } 435 } 436 ], 437 "loc": { 438 "start": { 439 "line": 19, 440 "column": 22 441 }, 442 "end": { 443 "line": 19, 444 "column": 37 445 } 446 } 447 }, 448 "loc": { 449 "start": { 450 "line": 19, 451 "column": 19 452 }, 453 "end": { 454 "line": 19, 455 "column": 39 456 } 457 } 458 } 459 ], 460 "loc": { 461 "start": { 462 "line": 19, 463 "column": 17 464 }, 465 "end": { 466 "line": 19, 467 "column": 39 468 } 469 } 470 }, 471 "decorators": [], 472 "loc": { 473 "start": { 474 "line": 19, 475 "column": 14 476 }, 477 "end": { 478 "line": 19, 479 "column": 15 480 } 481 } 482 } 483 ], 484 "body": { 485 "type": "BlockStatement", 486 "statements": [ 487 { 488 "type": "ReturnStatement", 489 "argument": { 490 "type": "NumberLiteral", 491 "value": 2, 492 "loc": { 493 "start": { 494 "line": 20, 495 "column": 12 496 }, 497 "end": { 498 "line": 20, 499 "column": 13 500 } 501 } 502 }, 503 "loc": { 504 "start": { 505 "line": 20, 506 "column": 5 507 }, 508 "end": { 509 "line": 20, 510 "column": 14 511 } 512 } 513 } 514 ], 515 "loc": { 516 "start": { 517 "line": 19, 518 "column": 41 519 }, 520 "end": { 521 "line": 21, 522 "column": 2 523 } 524 } 525 }, 526 "loc": { 527 "start": { 528 "line": 19, 529 "column": 1 530 }, 531 "end": { 532 "line": 21, 533 "column": 2 534 } 535 } 536 }, 537 "loc": { 538 "start": { 539 "line": 19, 540 "column": 1 541 }, 542 "end": { 543 "line": 21, 544 "column": 2 545 } 546 } 547 }, 548 { 549 "type": "ExpressionStatement", 550 "expression": { 551 "type": "CallExpression", 552 "callee": { 553 "type": "Identifier", 554 "name": "foo", 555 "decorators": [], 556 "loc": { 557 "start": { 558 "line": 23, 559 "column": 1 560 }, 561 "end": { 562 "line": 23, 563 "column": 4 564 } 565 } 566 }, 567 "arguments": [ 568 { 569 "type": "ObjectExpression", 570 "properties": [ 571 { 572 "type": "Property", 573 "method": false, 574 "shorthand": false, 575 "computed": false, 576 "key": { 577 "type": "Identifier", 578 "name": "x", 579 "decorators": [], 580 "loc": { 581 "start": { 582 "line": 23, 583 "column": 7 584 }, 585 "end": { 586 "line": 23, 587 "column": 8 588 } 589 } 590 }, 591 "value": { 592 "type": "BooleanLiteral", 593 "value": true, 594 "loc": { 595 "start": { 596 "line": 23, 597 "column": 10 598 }, 599 "end": { 600 "line": 23, 601 "column": 14 602 } 603 } 604 }, 605 "kind": "init", 606 "loc": { 607 "start": { 608 "line": 23, 609 "column": 7 610 }, 611 "end": { 612 "line": 23, 613 "column": 14 614 } 615 } 616 } 617 ], 618 "loc": { 619 "start": { 620 "line": 23, 621 "column": 5 622 }, 623 "end": { 624 "line": 23, 625 "column": 16 626 } 627 } 628 } 629 ], 630 "optional": false, 631 "loc": { 632 "start": { 633 "line": 23, 634 "column": 1 635 }, 636 "end": { 637 "line": 23, 638 "column": 17 639 } 640 } 641 }, 642 "loc": { 643 "start": { 644 "line": 23, 645 "column": 1 646 }, 647 "end": { 648 "line": 23, 649 "column": 18 650 } 651 } 652 } 653 ], 654 "loc": { 655 "start": { 656 "line": 1, 657 "column": 1 658 }, 659 "end": { 660 "line": 23, 661 "column": 18 662 } 663 } 664} 665TypeError: No overload matches this call. [functionOverload1.ts:23:1] 666