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