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