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