1{ 2 "type": "Program", 3 "statements": [ 4 { 5 "type": "FunctionDeclaration", 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": "AssignmentPattern", 29 "left": { 30 "type": "ArrayPattern", 31 "elements": [ 32 { 33 "type": "AssignmentPattern", 34 "left": { 35 "type": "Identifier", 36 "name": "a", 37 "decorators": [], 38 "loc": { 39 "start": { 40 "line": 17, 41 "column": 15 42 }, 43 "end": { 44 "line": 17, 45 "column": 16 46 } 47 } 48 }, 49 "right": { 50 "type": "NumberLiteral", 51 "value": 2, 52 "loc": { 53 "start": { 54 "line": 17, 55 "column": 19 56 }, 57 "end": { 58 "line": 17, 59 "column": 20 60 } 61 } 62 }, 63 "loc": { 64 "start": { 65 "line": 17, 66 "column": 15 67 }, 68 "end": { 69 "line": 17, 70 "column": 20 71 } 72 } 73 }, 74 { 75 "type": "ObjectPattern", 76 "properties": [ 77 { 78 "type": "Property", 79 "method": false, 80 "shorthand": false, 81 "computed": false, 82 "key": { 83 "type": "Identifier", 84 "name": "b", 85 "decorators": [], 86 "loc": { 87 "start": { 88 "line": 17, 89 "column": 24 90 }, 91 "end": { 92 "line": 17, 93 "column": 25 94 } 95 } 96 }, 97 "value": { 98 "type": "AssignmentPattern", 99 "left": { 100 "type": "ArrayPattern", 101 "elements": [ 102 { 103 "type": "AssignmentPattern", 104 "left": { 105 "type": "Identifier", 106 "name": "c", 107 "decorators": [], 108 "loc": { 109 "start": { 110 "line": 17, 111 "column": 28 112 }, 113 "end": { 114 "line": 17, 115 "column": 29 116 } 117 } 118 }, 119 "right": { 120 "type": "NumberLiteral", 121 "value": 6, 122 "loc": { 123 "start": { 124 "line": 17, 125 "column": 32 126 }, 127 "end": { 128 "line": 17, 129 "column": 33 130 } 131 } 132 }, 133 "loc": { 134 "start": { 135 "line": 17, 136 "column": 28 137 }, 138 "end": { 139 "line": 17, 140 "column": 33 141 } 142 } 143 }, 144 { 145 "type": "Identifier", 146 "name": "d", 147 "decorators": [], 148 "loc": { 149 "start": { 150 "line": 17, 151 "column": 35 152 }, 153 "end": { 154 "line": 17, 155 "column": 36 156 } 157 } 158 } 159 ], 160 "loc": { 161 "start": { 162 "line": 17, 163 "column": 27 164 }, 165 "end": { 166 "line": 17, 167 "column": 37 168 } 169 } 170 }, 171 "right": { 172 "type": "ArrayExpression", 173 "elements": [ 174 { 175 "type": "BooleanLiteral", 176 "value": true, 177 "loc": { 178 "start": { 179 "line": 17, 180 "column": 41 181 }, 182 "end": { 183 "line": 17, 184 "column": 45 185 } 186 } 187 }, 188 { 189 "type": "ArrayExpression", 190 "elements": [ 191 { 192 "type": "BigIntLiteral", 193 "value": "5", 194 "loc": { 195 "start": { 196 "line": 17, 197 "column": 48 198 }, 199 "end": { 200 "line": 17, 201 "column": 50 202 } 203 } 204 }, 205 { 206 "type": "StringLiteral", 207 "value": "foo", 208 "loc": { 209 "start": { 210 "line": 17, 211 "column": 52 212 }, 213 "end": { 214 "line": 17, 215 "column": 57 216 } 217 } 218 } 219 ], 220 "loc": { 221 "start": { 222 "line": 17, 223 "column": 47 224 }, 225 "end": { 226 "line": 17, 227 "column": 58 228 } 229 } 230 } 231 ], 232 "loc": { 233 "start": { 234 "line": 17, 235 "column": 40 236 }, 237 "end": { 238 "line": 17, 239 "column": 59 240 } 241 } 242 }, 243 "loc": { 244 "start": { 245 "line": 17, 246 "column": 27 247 }, 248 "end": { 249 "line": 17, 250 "column": 59 251 } 252 } 253 }, 254 "kind": "init", 255 "loc": { 256 "start": { 257 "line": 17, 258 "column": 24 259 }, 260 "end": { 261 "line": 17, 262 "column": 59 263 } 264 } 265 }, 266 { 267 "type": "Property", 268 "method": false, 269 "shorthand": true, 270 "computed": false, 271 "key": { 272 "type": "Identifier", 273 "name": "t", 274 "decorators": [], 275 "loc": { 276 "start": { 277 "line": 17, 278 "column": 61 279 }, 280 "end": { 281 "line": 17, 282 "column": 62 283 } 284 } 285 }, 286 "value": { 287 "type": "AssignmentPattern", 288 "left": { 289 "type": "Identifier", 290 "name": "t", 291 "decorators": [], 292 "loc": { 293 "start": { 294 "line": 17, 295 "column": 61 296 }, 297 "end": { 298 "line": 17, 299 "column": 62 300 } 301 } 302 }, 303 "right": { 304 "type": "ObjectExpression", 305 "properties": [ 306 { 307 "type": "Property", 308 "method": false, 309 "shorthand": false, 310 "computed": false, 311 "key": { 312 "type": "Identifier", 313 "name": "a", 314 "decorators": [], 315 "loc": { 316 "start": { 317 "line": 17, 318 "column": 67 319 }, 320 "end": { 321 "line": 17, 322 "column": 68 323 } 324 } 325 }, 326 "value": { 327 "type": "NumberLiteral", 328 "value": 3, 329 "loc": { 330 "start": { 331 "line": 17, 332 "column": 70 333 }, 334 "end": { 335 "line": 17, 336 "column": 71 337 } 338 } 339 }, 340 "kind": "init", 341 "loc": { 342 "start": { 343 "line": 17, 344 "column": 67 345 }, 346 "end": { 347 "line": 17, 348 "column": 71 349 } 350 } 351 }, 352 { 353 "type": "Property", 354 "method": false, 355 "shorthand": false, 356 "computed": false, 357 "key": { 358 "type": "Identifier", 359 "name": "b", 360 "decorators": [], 361 "loc": { 362 "start": { 363 "line": 17, 364 "column": 73 365 }, 366 "end": { 367 "line": 17, 368 "column": 74 369 } 370 } 371 }, 372 "value": { 373 "type": "ObjectExpression", 374 "properties": [ 375 { 376 "type": "Property", 377 "method": false, 378 "shorthand": false, 379 "computed": false, 380 "key": { 381 "type": "Identifier", 382 "name": "a", 383 "decorators": [], 384 "loc": { 385 "start": { 386 "line": 17, 387 "column": 78 388 }, 389 "end": { 390 "line": 17, 391 "column": 79 392 } 393 } 394 }, 395 "value": { 396 "type": "NumberLiteral", 397 "value": 2, 398 "loc": { 399 "start": { 400 "line": 17, 401 "column": 81 402 }, 403 "end": { 404 "line": 17, 405 "column": 82 406 } 407 } 408 }, 409 "kind": "init", 410 "loc": { 411 "start": { 412 "line": 17, 413 "column": 78 414 }, 415 "end": { 416 "line": 17, 417 "column": 82 418 } 419 } 420 }, 421 { 422 "type": "Property", 423 "method": false, 424 "shorthand": false, 425 "computed": false, 426 "key": { 427 "type": "Identifier", 428 "name": "b", 429 "decorators": [], 430 "loc": { 431 "start": { 432 "line": 17, 433 "column": 84 434 }, 435 "end": { 436 "line": 17, 437 "column": 85 438 } 439 } 440 }, 441 "value": { 442 "type": "BigIntLiteral", 443 "value": "5", 444 "loc": { 445 "start": { 446 "line": 17, 447 "column": 87 448 }, 449 "end": { 450 "line": 17, 451 "column": 89 452 } 453 } 454 }, 455 "kind": "init", 456 "loc": { 457 "start": { 458 "line": 17, 459 "column": 84 460 }, 461 "end": { 462 "line": 17, 463 "column": 89 464 } 465 } 466 } 467 ], 468 "loc": { 469 "start": { 470 "line": 17, 471 "column": 76 472 }, 473 "end": { 474 "line": 17, 475 "column": 91 476 } 477 } 478 }, 479 "kind": "init", 480 "loc": { 481 "start": { 482 "line": 17, 483 "column": 73 484 }, 485 "end": { 486 "line": 17, 487 "column": 91 488 } 489 } 490 } 491 ], 492 "loc": { 493 "start": { 494 "line": 17, 495 "column": 65 496 }, 497 "end": { 498 "line": 17, 499 "column": 93 500 } 501 } 502 }, 503 "loc": { 504 "start": { 505 "line": 17, 506 "column": 61 507 }, 508 "end": { 509 "line": 17, 510 "column": 93 511 } 512 } 513 }, 514 "kind": "init", 515 "loc": { 516 "start": { 517 "line": 17, 518 "column": 61 519 }, 520 "end": { 521 "line": 17, 522 "column": 93 523 } 524 } 525 } 526 ], 527 "loc": { 528 "start": { 529 "line": 17, 530 "column": 22 531 }, 532 "end": { 533 "line": 17, 534 "column": 95 535 } 536 } 537 } 538 ], 539 "loc": { 540 "start": { 541 "line": 17, 542 "column": 14 543 }, 544 "end": { 545 "line": 17, 546 "column": 96 547 } 548 } 549 }, 550 "right": { 551 "type": "ArrayExpression", 552 "elements": [ 553 { 554 "type": "StringLiteral", 555 "value": "foo", 556 "loc": { 557 "start": { 558 "line": 17, 559 "column": 100 560 }, 561 "end": { 562 "line": 17, 563 "column": 105 564 } 565 } 566 }, 567 { 568 "type": "ObjectExpression", 569 "properties": [], 570 "loc": { 571 "start": { 572 "line": 17, 573 "column": 107 574 }, 575 "end": { 576 "line": 17, 577 "column": 109 578 } 579 } 580 }, 581 { 582 "type": "BigIntLiteral", 583 "value": "4", 584 "loc": { 585 "start": { 586 "line": 17, 587 "column": 111 588 }, 589 "end": { 590 "line": 17, 591 "column": 113 592 } 593 } 594 } 595 ], 596 "loc": { 597 "start": { 598 "line": 17, 599 "column": 99 600 }, 601 "end": { 602 "line": 17, 603 "column": 114 604 } 605 } 606 }, 607 "loc": { 608 "start": { 609 "line": 17, 610 "column": 14 611 }, 612 "end": { 613 "line": 17, 614 "column": 114 615 } 616 } 617 }, 618 { 619 "type": "ObjectPattern", 620 "properties": [ 621 { 622 "type": "Property", 623 "method": false, 624 "shorthand": false, 625 "computed": false, 626 "key": { 627 "type": "Identifier", 628 "name": "r", 629 "decorators": [], 630 "loc": { 631 "start": { 632 "line": 17, 633 "column": 118 634 }, 635 "end": { 636 "line": 17, 637 "column": 119 638 } 639 } 640 }, 641 "value": { 642 "type": "AssignmentPattern", 643 "left": { 644 "type": "ArrayPattern", 645 "elements": [ 646 { 647 "type": "AssignmentPattern", 648 "left": { 649 "type": "ArrayPattern", 650 "elements": [ 651 { 652 "type": "Identifier", 653 "name": "r", 654 "decorators": [], 655 "loc": { 656 "start": { 657 "line": 17, 658 "column": 123 659 }, 660 "end": { 661 "line": 17, 662 "column": 124 663 } 664 } 665 }, 666 { 667 "type": "AssignmentPattern", 668 "left": { 669 "type": "Identifier", 670 "name": "z", 671 "decorators": [], 672 "loc": { 673 "start": { 674 "line": 17, 675 "column": 126 676 }, 677 "end": { 678 "line": 17, 679 "column": 127 680 } 681 } 682 }, 683 "right": { 684 "type": "NumberLiteral", 685 "value": 5, 686 "loc": { 687 "start": { 688 "line": 17, 689 "column": 130 690 }, 691 "end": { 692 "line": 17, 693 "column": 131 694 } 695 } 696 }, 697 "loc": { 698 "start": { 699 "line": 17, 700 "column": 126 701 }, 702 "end": { 703 "line": 17, 704 "column": 131 705 } 706 } 707 } 708 ], 709 "loc": { 710 "start": { 711 "line": 17, 712 "column": 122 713 }, 714 "end": { 715 "line": 17, 716 "column": 132 717 } 718 } 719 }, 720 "right": { 721 "type": "ArrayExpression", 722 "elements": [ 723 { 724 "type": "BooleanLiteral", 725 "value": true, 726 "loc": { 727 "start": { 728 "line": 17, 729 "column": 136 730 }, 731 "end": { 732 "line": 17, 733 "column": 140 734 } 735 } 736 } 737 ], 738 "loc": { 739 "start": { 740 "line": 17, 741 "column": 135 742 }, 743 "end": { 744 "line": 17, 745 "column": 141 746 } 747 } 748 }, 749 "loc": { 750 "start": { 751 "line": 17, 752 "column": 122 753 }, 754 "end": { 755 "line": 17, 756 "column": 141 757 } 758 } 759 } 760 ], 761 "loc": { 762 "start": { 763 "line": 17, 764 "column": 121 765 }, 766 "end": { 767 "line": 17, 768 "column": 142 769 } 770 } 771 }, 772 "right": { 773 "type": "ArrayExpression", 774 "elements": [ 775 { 776 "type": "ArrayExpression", 777 "elements": [ 778 { 779 "type": "NumberLiteral", 780 "value": 2, 781 "loc": { 782 "start": { 783 "line": 17, 784 "column": 147 785 }, 786 "end": { 787 "line": 17, 788 "column": 148 789 } 790 } 791 }, 792 { 793 "type": "StringLiteral", 794 "value": "foo", 795 "loc": { 796 "start": { 797 "line": 17, 798 "column": 150 799 }, 800 "end": { 801 "line": 17, 802 "column": 155 803 } 804 } 805 } 806 ], 807 "loc": { 808 "start": { 809 "line": 17, 810 "column": 146 811 }, 812 "end": { 813 "line": 17, 814 "column": 156 815 } 816 } 817 } 818 ], 819 "loc": { 820 "start": { 821 "line": 17, 822 "column": 145 823 }, 824 "end": { 825 "line": 17, 826 "column": 157 827 } 828 } 829 }, 830 "loc": { 831 "start": { 832 "line": 17, 833 "column": 121 834 }, 835 "end": { 836 "line": 17, 837 "column": 157 838 } 839 } 840 }, 841 "kind": "init", 842 "loc": { 843 "start": { 844 "line": 17, 845 "column": 118 846 }, 847 "end": { 848 "line": 17, 849 "column": 157 850 } 851 } 852 } 853 ], 854 "loc": { 855 "start": { 856 "line": 17, 857 "column": 116 858 }, 859 "end": { 860 "line": 17, 861 "column": 159 862 } 863 } 864 } 865 ], 866 "body": { 867 "type": "BlockStatement", 868 "statements": [], 869 "loc": { 870 "start": { 871 "line": 17, 872 "column": 161 873 }, 874 "end": { 875 "line": 19, 876 "column": 2 877 } 878 } 879 }, 880 "loc": { 881 "start": { 882 "line": 17, 883 "column": 1 884 }, 885 "end": { 886 "line": 19, 887 "column": 2 888 } 889 } 890 }, 891 "loc": { 892 "start": { 893 "line": 17, 894 "column": 1 895 }, 896 "end": { 897 "line": 19, 898 "column": 2 899 } 900 } 901 }, 902 { 903 "type": "ExpressionStatement", 904 "expression": { 905 "type": "CallExpression", 906 "callee": { 907 "type": "Identifier", 908 "name": "foo", 909 "decorators": [], 910 "loc": { 911 "start": { 912 "line": 21, 913 "column": 1 914 }, 915 "end": { 916 "line": 21, 917 "column": 4 918 } 919 } 920 }, 921 "arguments": [ 922 { 923 "type": "ArrayExpression", 924 "elements": [ 925 { 926 "type": "StringLiteral", 927 "value": "foo", 928 "loc": { 929 "start": { 930 "line": 21, 931 "column": 6 932 }, 933 "end": { 934 "line": 21, 935 "column": 11 936 } 937 } 938 }, 939 { 940 "type": "ObjectExpression", 941 "properties": [], 942 "loc": { 943 "start": { 944 "line": 21, 945 "column": 13 946 }, 947 "end": { 948 "line": 21, 949 "column": 15 950 } 951 } 952 }, 953 { 954 "type": "BigIntLiteral", 955 "value": "5", 956 "loc": { 957 "start": { 958 "line": 21, 959 "column": 17 960 }, 961 "end": { 962 "line": 21, 963 "column": 19 964 } 965 } 966 } 967 ], 968 "loc": { 969 "start": { 970 "line": 21, 971 "column": 5 972 }, 973 "end": { 974 "line": 21, 975 "column": 20 976 } 977 } 978 }, 979 { 980 "type": "ObjectExpression", 981 "properties": [ 982 { 983 "type": "Property", 984 "method": false, 985 "shorthand": false, 986 "computed": false, 987 "key": { 988 "type": "Identifier", 989 "name": "r", 990 "decorators": [], 991 "loc": { 992 "start": { 993 "line": 21, 994 "column": 24 995 }, 996 "end": { 997 "line": 21, 998 "column": 25 999 } 1000 } 1001 }, 1002 "value": { 1003 "type": "ArrayExpression", 1004 "elements": [ 1005 { 1006 "type": "ArrayExpression", 1007 "elements": [ 1008 { 1009 "type": "StringLiteral", 1010 "value": "foo", 1011 "loc": { 1012 "start": { 1013 "line": 21, 1014 "column": 29 1015 }, 1016 "end": { 1017 "line": 21, 1018 "column": 34 1019 } 1020 } 1021 } 1022 ], 1023 "loc": { 1024 "start": { 1025 "line": 21, 1026 "column": 28 1027 }, 1028 "end": { 1029 "line": 21, 1030 "column": 35 1031 } 1032 } 1033 } 1034 ], 1035 "loc": { 1036 "start": { 1037 "line": 21, 1038 "column": 27 1039 }, 1040 "end": { 1041 "line": 21, 1042 "column": 36 1043 } 1044 } 1045 }, 1046 "kind": "init", 1047 "loc": { 1048 "start": { 1049 "line": 21, 1050 "column": 24 1051 }, 1052 "end": { 1053 "line": 21, 1054 "column": 36 1055 } 1056 } 1057 } 1058 ], 1059 "loc": { 1060 "start": { 1061 "line": 21, 1062 "column": 22 1063 }, 1064 "end": { 1065 "line": 21, 1066 "column": 38 1067 } 1068 } 1069 } 1070 ], 1071 "optional": false, 1072 "loc": { 1073 "start": { 1074 "line": 21, 1075 "column": 1 1076 }, 1077 "end": { 1078 "line": 21, 1079 "column": 39 1080 } 1081 } 1082 }, 1083 "loc": { 1084 "start": { 1085 "line": 21, 1086 "column": 1 1087 }, 1088 "end": { 1089 "line": 21, 1090 "column": 40 1091 } 1092 } 1093 } 1094 ], 1095 "loc": { 1096 "start": { 1097 "line": 1, 1098 "column": 1 1099 }, 1100 "end": { 1101 "line": 22, 1102 "column": 1 1103 } 1104 } 1105} 1106TypeError: Type 'string' is not assignable to type 'number'. [functionWithPattern12.ts:21:29] 1107