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