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