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