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 "program": "functions_with_ambiguous_rest_parameter.ets" 16 }, 17 "end": { 18 "line": 1, 19 "column": 1, 20 "program": "functions_with_ambiguous_rest_parameter.ets" 21 } 22 } 23 }, 24 "superClass": null, 25 "implements": [], 26 "body": [ 27 { 28 "type": "MethodDefinition", 29 "key": { 30 "type": "Identifier", 31 "name": "_$init$_", 32 "decorators": [], 33 "loc": { 34 "start": { 35 "line": 1, 36 "column": 1, 37 "program": null 38 }, 39 "end": { 40 "line": 1, 41 "column": 1, 42 "program": null 43 } 44 } 45 }, 46 "kind": "method", 47 "accessibility": "public", 48 "static": true, 49 "optional": false, 50 "computed": false, 51 "value": { 52 "type": "FunctionExpression", 53 "function": { 54 "type": "ScriptFunction", 55 "id": { 56 "type": "Identifier", 57 "name": "_$init$_", 58 "decorators": [], 59 "loc": { 60 "start": { 61 "line": 1, 62 "column": 1, 63 "program": null 64 }, 65 "end": { 66 "line": 1, 67 "column": 1, 68 "program": null 69 } 70 } 71 }, 72 "generator": false, 73 "async": false, 74 "expression": false, 75 "params": [], 76 "body": { 77 "type": "BlockStatement", 78 "statements": [], 79 "loc": { 80 "start": { 81 "line": 1, 82 "column": 1, 83 "program": null 84 }, 85 "end": { 86 "line": 1, 87 "column": 1, 88 "program": null 89 } 90 } 91 }, 92 "loc": { 93 "start": { 94 "line": 1, 95 "column": 1, 96 "program": null 97 }, 98 "end": { 99 "line": 1, 100 "column": 1, 101 "program": null 102 } 103 } 104 }, 105 "loc": { 106 "start": { 107 "line": 1, 108 "column": 1, 109 "program": null 110 }, 111 "end": { 112 "line": 1, 113 "column": 1, 114 "program": null 115 } 116 } 117 }, 118 "overloads": [], 119 "decorators": [], 120 "loc": { 121 "start": { 122 "line": 1, 123 "column": 1, 124 "program": "functions_with_ambiguous_rest_parameter.ets" 125 }, 126 "end": { 127 "line": 1, 128 "column": 1, 129 "program": "functions_with_ambiguous_rest_parameter.ets" 130 } 131 } 132 }, 133 { 134 "type": "MethodDefinition", 135 "key": { 136 "type": "Identifier", 137 "name": "foo", 138 "decorators": [], 139 "loc": { 140 "start": { 141 "line": 16, 142 "column": 10, 143 "program": "functions_with_ambiguous_rest_parameter.ets" 144 }, 145 "end": { 146 "line": 16, 147 "column": 13, 148 "program": "functions_with_ambiguous_rest_parameter.ets" 149 } 150 } 151 }, 152 "kind": "method", 153 "accessibility": "public", 154 "static": true, 155 "optional": false, 156 "computed": false, 157 "value": { 158 "type": "FunctionExpression", 159 "function": { 160 "type": "ScriptFunction", 161 "id": { 162 "type": "Identifier", 163 "name": "foo", 164 "decorators": [], 165 "loc": { 166 "start": { 167 "line": 16, 168 "column": 10, 169 "program": "functions_with_ambiguous_rest_parameter.ets" 170 }, 171 "end": { 172 "line": 16, 173 "column": 13, 174 "program": "functions_with_ambiguous_rest_parameter.ets" 175 } 176 } 177 }, 178 "generator": false, 179 "async": false, 180 "expression": false, 181 "params": [ 182 { 183 "type": "ETSParameterExpression", 184 "rest parameter": { 185 "type": "RestElement", 186 "argument": { 187 "type": "Identifier", 188 "name": "n", 189 "decorators": [], 190 "loc": { 191 "start": { 192 "line": 16, 193 "column": 17, 194 "program": "functions_with_ambiguous_rest_parameter.ets" 195 }, 196 "end": { 197 "line": 16, 198 "column": 18, 199 "program": "functions_with_ambiguous_rest_parameter.ets" 200 } 201 } 202 }, 203 "typeAnnotation": { 204 "type": "ETSTypeReference", 205 "part": { 206 "type": "ETSTypeReferencePart", 207 "name": { 208 "type": "Identifier", 209 "name": "Array", 210 "decorators": [], 211 "loc": { 212 "start": { 213 "line": 1, 214 "column": 1, 215 "program": "functions_with_ambiguous_rest_parameter.ets" 216 }, 217 "end": { 218 "line": 1, 219 "column": 3, 220 "program": "functions_with_ambiguous_rest_parameter.ets" 221 } 222 } 223 }, 224 "typeParams": { 225 "type": "TSTypeParameterInstantiation", 226 "params": [ 227 { 228 "type": "ETSTypeReference", 229 "part": { 230 "type": "ETSTypeReferencePart", 231 "name": { 232 "type": "Identifier", 233 "name": "number", 234 "decorators": [], 235 "loc": { 236 "start": { 237 "line": 1, 238 "column": 3, 239 "program": "functions_with_ambiguous_rest_parameter.ets" 240 }, 241 "end": { 242 "line": 1, 243 "column": 3, 244 "program": "functions_with_ambiguous_rest_parameter.ets" 245 } 246 } 247 }, 248 "loc": { 249 "start": { 250 "line": 1, 251 "column": 3, 252 "program": "functions_with_ambiguous_rest_parameter.ets" 253 }, 254 "end": { 255 "line": 1, 256 "column": 3, 257 "program": "functions_with_ambiguous_rest_parameter.ets" 258 } 259 } 260 }, 261 "loc": { 262 "start": { 263 "line": 1, 264 "column": 3, 265 "program": "functions_with_ambiguous_rest_parameter.ets" 266 }, 267 "end": { 268 "line": 1, 269 "column": 3, 270 "program": "functions_with_ambiguous_rest_parameter.ets" 271 } 272 } 273 } 274 ], 275 "loc": { 276 "start": { 277 "line": 1, 278 "column": 3, 279 "program": "functions_with_ambiguous_rest_parameter.ets" 280 }, 281 "end": { 282 "line": 1, 283 "column": 3, 284 "program": "functions_with_ambiguous_rest_parameter.ets" 285 } 286 } 287 }, 288 "loc": { 289 "start": { 290 "line": 1, 291 "column": 1, 292 "program": "functions_with_ambiguous_rest_parameter.ets" 293 }, 294 "end": { 295 "line": 1, 296 "column": 3, 297 "program": "functions_with_ambiguous_rest_parameter.ets" 298 } 299 } 300 }, 301 "loc": { 302 "start": { 303 "line": 16, 304 "column": 26, 305 "program": "functions_with_ambiguous_rest_parameter.ets" 306 }, 307 "end": { 308 "line": 16, 309 "column": 28, 310 "program": "functions_with_ambiguous_rest_parameter.ets" 311 } 312 } 313 }, 314 "loc": { 315 "start": { 316 "line": 16, 317 "column": 14, 318 "program": "functions_with_ambiguous_rest_parameter.ets" 319 }, 320 "end": { 321 "line": 16, 322 "column": 28, 323 "program": "functions_with_ambiguous_rest_parameter.ets" 324 } 325 } 326 }, 327 "loc": { 328 "start": { 329 "line": 16, 330 "column": 14, 331 "program": "functions_with_ambiguous_rest_parameter.ets" 332 }, 333 "end": { 334 "line": 16, 335 "column": 28, 336 "program": "functions_with_ambiguous_rest_parameter.ets" 337 } 338 } 339 } 340 ], 341 "returnType": { 342 "type": "ETSPrimitiveType", 343 "loc": { 344 "start": { 345 "line": 16, 346 "column": 31, 347 "program": "functions_with_ambiguous_rest_parameter.ets" 348 }, 349 "end": { 350 "line": 16, 351 "column": 35, 352 "program": "functions_with_ambiguous_rest_parameter.ets" 353 } 354 } 355 }, 356 "body": { 357 "type": "BlockStatement", 358 "statements": [], 359 "loc": { 360 "start": { 361 "line": 16, 362 "column": 36, 363 "program": "functions_with_ambiguous_rest_parameter.ets" 364 }, 365 "end": { 366 "line": 18, 367 "column": 2, 368 "program": "functions_with_ambiguous_rest_parameter.ets" 369 } 370 } 371 }, 372 "loc": { 373 "start": { 374 "line": 16, 375 "column": 10, 376 "program": "functions_with_ambiguous_rest_parameter.ets" 377 }, 378 "end": { 379 "line": 18, 380 "column": 2, 381 "program": "functions_with_ambiguous_rest_parameter.ets" 382 } 383 } 384 }, 385 "loc": { 386 "start": { 387 "line": 16, 388 "column": 10, 389 "program": "functions_with_ambiguous_rest_parameter.ets" 390 }, 391 "end": { 392 "line": 18, 393 "column": 2, 394 "program": "functions_with_ambiguous_rest_parameter.ets" 395 } 396 } 397 }, 398 "overloads": [ 399 { 400 "type": "MethodDefinition", 401 "key": { 402 "type": "Identifier", 403 "name": "foo", 404 "decorators": [], 405 "loc": { 406 "start": { 407 "line": 20, 408 "column": 10, 409 "program": "functions_with_ambiguous_rest_parameter.ets" 410 }, 411 "end": { 412 "line": 20, 413 "column": 13, 414 "program": "functions_with_ambiguous_rest_parameter.ets" 415 } 416 } 417 }, 418 "kind": "method", 419 "accessibility": "public", 420 "static": true, 421 "optional": false, 422 "computed": false, 423 "value": { 424 "type": "FunctionExpression", 425 "function": { 426 "type": "ScriptFunction", 427 "id": { 428 "type": "Identifier", 429 "name": "foo", 430 "decorators": [], 431 "loc": { 432 "start": { 433 "line": 20, 434 "column": 10, 435 "program": "functions_with_ambiguous_rest_parameter.ets" 436 }, 437 "end": { 438 "line": 20, 439 "column": 13, 440 "program": "functions_with_ambiguous_rest_parameter.ets" 441 } 442 } 443 }, 444 "generator": false, 445 "async": false, 446 "expression": false, 447 "params": [ 448 { 449 "type": "ETSParameterExpression", 450 "rest parameter": { 451 "type": "RestElement", 452 "argument": { 453 "type": "Identifier", 454 "name": "s", 455 "decorators": [], 456 "loc": { 457 "start": { 458 "line": 20, 459 "column": 17, 460 "program": "functions_with_ambiguous_rest_parameter.ets" 461 }, 462 "end": { 463 "line": 20, 464 "column": 18, 465 "program": "functions_with_ambiguous_rest_parameter.ets" 466 } 467 } 468 }, 469 "typeAnnotation": { 470 "type": "ETSTypeReference", 471 "part": { 472 "type": "ETSTypeReferencePart", 473 "name": { 474 "type": "Identifier", 475 "name": "Array", 476 "decorators": [], 477 "loc": { 478 "start": { 479 "line": 1, 480 "column": 1, 481 "program": "functions_with_ambiguous_rest_parameter.ets" 482 }, 483 "end": { 484 "line": 1, 485 "column": 3, 486 "program": "functions_with_ambiguous_rest_parameter.ets" 487 } 488 } 489 }, 490 "typeParams": { 491 "type": "TSTypeParameterInstantiation", 492 "params": [ 493 { 494 "type": "ETSTypeReference", 495 "part": { 496 "type": "ETSTypeReferencePart", 497 "name": { 498 "type": "Identifier", 499 "name": "string", 500 "decorators": [], 501 "loc": { 502 "start": { 503 "line": 1, 504 "column": 3, 505 "program": "functions_with_ambiguous_rest_parameter.ets" 506 }, 507 "end": { 508 "line": 1, 509 "column": 3, 510 "program": "functions_with_ambiguous_rest_parameter.ets" 511 } 512 } 513 }, 514 "loc": { 515 "start": { 516 "line": 1, 517 "column": 3, 518 "program": "functions_with_ambiguous_rest_parameter.ets" 519 }, 520 "end": { 521 "line": 1, 522 "column": 3, 523 "program": "functions_with_ambiguous_rest_parameter.ets" 524 } 525 } 526 }, 527 "loc": { 528 "start": { 529 "line": 1, 530 "column": 3, 531 "program": "functions_with_ambiguous_rest_parameter.ets" 532 }, 533 "end": { 534 "line": 1, 535 "column": 3, 536 "program": "functions_with_ambiguous_rest_parameter.ets" 537 } 538 } 539 } 540 ], 541 "loc": { 542 "start": { 543 "line": 1, 544 "column": 3, 545 "program": "functions_with_ambiguous_rest_parameter.ets" 546 }, 547 "end": { 548 "line": 1, 549 "column": 3, 550 "program": "functions_with_ambiguous_rest_parameter.ets" 551 } 552 } 553 }, 554 "loc": { 555 "start": { 556 "line": 1, 557 "column": 1, 558 "program": "functions_with_ambiguous_rest_parameter.ets" 559 }, 560 "end": { 561 "line": 1, 562 "column": 3, 563 "program": "functions_with_ambiguous_rest_parameter.ets" 564 } 565 } 566 }, 567 "loc": { 568 "start": { 569 "line": 20, 570 "column": 26, 571 "program": "functions_with_ambiguous_rest_parameter.ets" 572 }, 573 "end": { 574 "line": 20, 575 "column": 28, 576 "program": "functions_with_ambiguous_rest_parameter.ets" 577 } 578 } 579 }, 580 "loc": { 581 "start": { 582 "line": 20, 583 "column": 14, 584 "program": "functions_with_ambiguous_rest_parameter.ets" 585 }, 586 "end": { 587 "line": 20, 588 "column": 28, 589 "program": "functions_with_ambiguous_rest_parameter.ets" 590 } 591 } 592 }, 593 "loc": { 594 "start": { 595 "line": 20, 596 "column": 14, 597 "program": "functions_with_ambiguous_rest_parameter.ets" 598 }, 599 "end": { 600 "line": 20, 601 "column": 28, 602 "program": "functions_with_ambiguous_rest_parameter.ets" 603 } 604 } 605 } 606 ], 607 "returnType": { 608 "type": "ETSPrimitiveType", 609 "loc": { 610 "start": { 611 "line": 20, 612 "column": 31, 613 "program": "functions_with_ambiguous_rest_parameter.ets" 614 }, 615 "end": { 616 "line": 20, 617 "column": 35, 618 "program": "functions_with_ambiguous_rest_parameter.ets" 619 } 620 } 621 }, 622 "body": { 623 "type": "BlockStatement", 624 "statements": [], 625 "loc": { 626 "start": { 627 "line": 20, 628 "column": 36, 629 "program": "functions_with_ambiguous_rest_parameter.ets" 630 }, 631 "end": { 632 "line": 22, 633 "column": 2, 634 "program": "functions_with_ambiguous_rest_parameter.ets" 635 } 636 } 637 }, 638 "loc": { 639 "start": { 640 "line": 20, 641 "column": 10, 642 "program": "functions_with_ambiguous_rest_parameter.ets" 643 }, 644 "end": { 645 "line": 22, 646 "column": 2, 647 "program": "functions_with_ambiguous_rest_parameter.ets" 648 } 649 } 650 }, 651 "loc": { 652 "start": { 653 "line": 20, 654 "column": 10, 655 "program": "functions_with_ambiguous_rest_parameter.ets" 656 }, 657 "end": { 658 "line": 22, 659 "column": 2, 660 "program": "functions_with_ambiguous_rest_parameter.ets" 661 } 662 } 663 }, 664 "overloads": [], 665 "decorators": [], 666 "loc": { 667 "start": { 668 "line": 20, 669 "column": 1, 670 "program": "functions_with_ambiguous_rest_parameter.ets" 671 }, 672 "end": { 673 "line": 22, 674 "column": 2, 675 "program": "functions_with_ambiguous_rest_parameter.ets" 676 } 677 } 678 } 679 ], 680 "decorators": [], 681 "loc": { 682 "start": { 683 "line": 16, 684 "column": 1, 685 "program": "functions_with_ambiguous_rest_parameter.ets" 686 }, 687 "end": { 688 "line": 18, 689 "column": 2, 690 "program": "functions_with_ambiguous_rest_parameter.ets" 691 } 692 } 693 }, 694 { 695 "type": "MethodDefinition", 696 "key": { 697 "type": "Identifier", 698 "name": "main", 699 "decorators": [], 700 "loc": { 701 "start": { 702 "line": 24, 703 "column": 10, 704 "program": "functions_with_ambiguous_rest_parameter.ets" 705 }, 706 "end": { 707 "line": 24, 708 "column": 14, 709 "program": "functions_with_ambiguous_rest_parameter.ets" 710 } 711 } 712 }, 713 "kind": "method", 714 "accessibility": "public", 715 "static": true, 716 "optional": false, 717 "computed": false, 718 "value": { 719 "type": "FunctionExpression", 720 "function": { 721 "type": "ScriptFunction", 722 "id": { 723 "type": "Identifier", 724 "name": "main", 725 "decorators": [], 726 "loc": { 727 "start": { 728 "line": 24, 729 "column": 10, 730 "program": "functions_with_ambiguous_rest_parameter.ets" 731 }, 732 "end": { 733 "line": 24, 734 "column": 14, 735 "program": "functions_with_ambiguous_rest_parameter.ets" 736 } 737 } 738 }, 739 "generator": false, 740 "async": false, 741 "expression": false, 742 "params": [], 743 "returnType": { 744 "type": "ETSPrimitiveType", 745 "loc": { 746 "start": { 747 "line": 24, 748 "column": 18, 749 "program": "functions_with_ambiguous_rest_parameter.ets" 750 }, 751 "end": { 752 "line": 24, 753 "column": 22, 754 "program": "functions_with_ambiguous_rest_parameter.ets" 755 } 756 } 757 }, 758 "body": { 759 "type": "BlockStatement", 760 "statements": [ 761 { 762 "type": "ExpressionStatement", 763 "expression": { 764 "type": "CallExpression", 765 "callee": { 766 "type": "Identifier", 767 "name": "foo", 768 "decorators": [], 769 "loc": { 770 "start": { 771 "line": 25, 772 "column": 5, 773 "program": "functions_with_ambiguous_rest_parameter.ets" 774 }, 775 "end": { 776 "line": 25, 777 "column": 8, 778 "program": "functions_with_ambiguous_rest_parameter.ets" 779 } 780 } 781 }, 782 "arguments": [], 783 "optional": false, 784 "loc": { 785 "start": { 786 "line": 25, 787 "column": 5, 788 "program": "functions_with_ambiguous_rest_parameter.ets" 789 }, 790 "end": { 791 "line": 25, 792 "column": 10, 793 "program": "functions_with_ambiguous_rest_parameter.ets" 794 } 795 } 796 }, 797 "loc": { 798 "start": { 799 "line": 25, 800 "column": 5, 801 "program": "functions_with_ambiguous_rest_parameter.ets" 802 }, 803 "end": { 804 "line": 25, 805 "column": 11, 806 "program": "functions_with_ambiguous_rest_parameter.ets" 807 } 808 } 809 } 810 ], 811 "loc": { 812 "start": { 813 "line": 24, 814 "column": 23, 815 "program": "functions_with_ambiguous_rest_parameter.ets" 816 }, 817 "end": { 818 "line": 26, 819 "column": 2, 820 "program": "functions_with_ambiguous_rest_parameter.ets" 821 } 822 } 823 }, 824 "loc": { 825 "start": { 826 "line": 24, 827 "column": 10, 828 "program": "functions_with_ambiguous_rest_parameter.ets" 829 }, 830 "end": { 831 "line": 26, 832 "column": 2, 833 "program": "functions_with_ambiguous_rest_parameter.ets" 834 } 835 } 836 }, 837 "loc": { 838 "start": { 839 "line": 24, 840 "column": 10, 841 "program": "functions_with_ambiguous_rest_parameter.ets" 842 }, 843 "end": { 844 "line": 26, 845 "column": 2, 846 "program": "functions_with_ambiguous_rest_parameter.ets" 847 } 848 } 849 }, 850 "overloads": [], 851 "decorators": [], 852 "loc": { 853 "start": { 854 "line": 24, 855 "column": 1, 856 "program": "functions_with_ambiguous_rest_parameter.ets" 857 }, 858 "end": { 859 "line": 26, 860 "column": 2, 861 "program": "functions_with_ambiguous_rest_parameter.ets" 862 } 863 } 864 } 865 ], 866 "loc": { 867 "start": { 868 "line": 1, 869 "column": 1, 870 "program": "functions_with_ambiguous_rest_parameter.ets" 871 }, 872 "end": { 873 "line": 1, 874 "column": 1, 875 "program": "functions_with_ambiguous_rest_parameter.ets" 876 } 877 } 878 }, 879 "loc": { 880 "start": { 881 "line": 1, 882 "column": 1, 883 "program": "functions_with_ambiguous_rest_parameter.ets" 884 }, 885 "end": { 886 "line": 1, 887 "column": 1, 888 "program": "functions_with_ambiguous_rest_parameter.ets" 889 } 890 } 891 } 892 ], 893 "loc": { 894 "start": { 895 "line": 1, 896 "column": 1, 897 "program": "functions_with_ambiguous_rest_parameter.ets" 898 }, 899 "end": { 900 "line": 26, 901 "column": 2, 902 "program": "functions_with_ambiguous_rest_parameter.ets" 903 } 904 } 905} 906TypeError: Function foo with this assembly signature already declared. [functions_with_ambiguous_rest_parameter.ets:20:1] 907TypeError: Call to `foo` is ambiguous [functions_with_ambiguous_rest_parameter.ets:25:5] 908TypeError: Reference to foo is ambiguous [functions_with_ambiguous_rest_parameter.ets:25:5] 909