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