• 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            "decorators": [],
13            "loc": {
14              "start": {
15                "line": 17,
16                "column": 5
17              },
18              "end": {
19                "line": 17,
20                "column": 6
21              }
22            }
23          },
24          "init": {
25            "type": "ObjectExpression",
26            "properties": [],
27            "loc": {
28              "start": {
29                "line": 17,
30                "column": 9
31              },
32              "end": {
33                "line": 17,
34                "column": 11
35              }
36            }
37          },
38          "loc": {
39            "start": {
40              "line": 17,
41              "column": 5
42            },
43            "end": {
44              "line": 17,
45              "column": 11
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": 12
59        }
60      }
61    },
62    {
63      "type": "VariableDeclaration",
64      "declarations": [
65        {
66          "type": "VariableDeclarator",
67          "id": {
68            "type": "Identifier",
69            "name": "b",
70            "typeAnnotation": {
71              "type": "TSNumberKeyword",
72              "loc": {
73                "start": {
74                  "line": 18,
75                  "column": 8
76                },
77                "end": {
78                  "line": 18,
79                  "column": 14
80                }
81              }
82            },
83            "decorators": [],
84            "loc": {
85              "start": {
86                "line": 18,
87                "column": 5
88              },
89              "end": {
90                "line": 18,
91                "column": 6
92              }
93            }
94          },
95          "init": null,
96          "loc": {
97            "start": {
98              "line": 18,
99              "column": 5
100            },
101            "end": {
102              "line": 18,
103              "column": 6
104            }
105          }
106        }
107      ],
108      "kind": "var",
109      "loc": {
110        "start": {
111          "line": 18,
112          "column": 1
113        },
114        "end": {
115          "line": 18,
116          "column": 15
117        }
118      }
119    },
120    {
121      "type": "VariableDeclaration",
122      "declarations": [
123        {
124          "type": "VariableDeclarator",
125          "id": {
126            "type": "Identifier",
127            "name": "c",
128            "typeAnnotation": {
129              "type": "TSStringKeyword",
130              "loc": {
131                "start": {
132                  "line": 19,
133                  "column": 7
134                },
135                "end": {
136                  "line": 19,
137                  "column": 13
138                }
139              }
140            },
141            "decorators": [],
142            "loc": {
143              "start": {
144                "line": 19,
145                "column": 5
146              },
147              "end": {
148                "line": 19,
149                "column": 6
150              }
151            }
152          },
153          "init": null,
154          "loc": {
155            "start": {
156              "line": 19,
157              "column": 5
158            },
159            "end": {
160              "line": 19,
161              "column": 6
162            }
163          }
164        }
165      ],
166      "kind": "var",
167      "loc": {
168        "start": {
169          "line": 19,
170          "column": 1
171        },
172        "end": {
173          "line": 19,
174          "column": 14
175        }
176      }
177    },
178    {
179      "type": "VariableDeclaration",
180      "declarations": [
181        {
182          "type": "VariableDeclarator",
183          "id": {
184            "type": "Identifier",
185            "name": "d",
186            "decorators": [],
187            "loc": {
188              "start": {
189                "line": 20,
190                "column": 5
191              },
192              "end": {
193                "line": 20,
194                "column": 6
195              }
196            }
197          },
198          "init": {
199            "type": "ArrayExpression",
200            "elements": [],
201            "loc": {
202              "start": {
203                "line": 20,
204                "column": 9
205              },
206              "end": {
207                "line": 20,
208                "column": 11
209              }
210            }
211          },
212          "loc": {
213            "start": {
214              "line": 20,
215              "column": 5
216            },
217            "end": {
218              "line": 20,
219              "column": 11
220            }
221          }
222        }
223      ],
224      "kind": "var",
225      "loc": {
226        "start": {
227          "line": 20,
228          "column": 1
229        },
230        "end": {
231          "line": 20,
232          "column": 12
233        }
234      }
235    },
236    {
237      "type": "ExpressionStatement",
238      "expression": {
239        "type": "AssignmentExpression",
240        "operator": "=",
241        "left": {
242          "type": "ArrayPattern",
243          "elements": [
244            {
245              "type": "Identifier",
246              "name": "a",
247              "decorators": [],
248              "loc": {
249                "start": {
250                  "line": 21,
251                  "column": 2
252                },
253                "end": {
254                  "line": 21,
255                  "column": 3
256                }
257              }
258            },
259            {
260              "type": "AssignmentPattern",
261              "left": {
262                "type": "ArrayPattern",
263                "elements": [
264                  {
265                    "type": "Identifier",
266                    "name": "b",
267                    "decorators": [],
268                    "loc": {
269                      "start": {
270                        "line": 21,
271                        "column": 6
272                      },
273                      "end": {
274                        "line": 21,
275                        "column": 7
276                      }
277                    }
278                  },
279                  {
280                    "type": "OmittedExpression",
281                    "loc": {
282                      "start": {
283                        "line": 21,
284                        "column": 9
285                      },
286                      "end": {
287                        "line": 21,
288                        "column": 10
289                      }
290                    }
291                  },
292                  {
293                    "type": "AssignmentPattern",
294                    "left": {
295                      "type": "Identifier",
296                      "name": "c",
297                      "decorators": [],
298                      "loc": {
299                        "start": {
300                          "line": 21,
301                          "column": 11
302                        },
303                        "end": {
304                          "line": 21,
305                          "column": 12
306                        }
307                      }
308                    },
309                    "right": {
310                      "type": "StringLiteral",
311                      "value": "bar",
312                      "loc": {
313                        "start": {
314                          "line": 21,
315                          "column": 15
316                        },
317                        "end": {
318                          "line": 21,
319                          "column": 20
320                        }
321                      }
322                    },
323                    "loc": {
324                      "start": {
325                        "line": 21,
326                        "column": 11
327                      },
328                      "end": {
329                        "line": 21,
330                        "column": 20
331                      }
332                    }
333                  }
334                ],
335                "loc": {
336                  "start": {
337                    "line": 21,
338                    "column": 5
339                  },
340                  "end": {
341                    "line": 21,
342                    "column": 21
343                  }
344                }
345              },
346              "right": {
347                "type": "ArrayExpression",
348                "elements": [
349                  {
350                    "type": "StringLiteral",
351                    "value": "foo",
352                    "loc": {
353                      "start": {
354                        "line": 21,
355                        "column": 25
356                      },
357                      "end": {
358                        "line": 21,
359                        "column": 30
360                      }
361                    }
362                  },
363                  {
364                    "type": "NumberLiteral",
365                    "value": 5,
366                    "loc": {
367                      "start": {
368                        "line": 21,
369                        "column": 32
370                      },
371                      "end": {
372                        "line": 21,
373                        "column": 33
374                      }
375                    }
376                  }
377                ],
378                "loc": {
379                  "start": {
380                    "line": 21,
381                    "column": 24
382                  },
383                  "end": {
384                    "line": 21,
385                    "column": 34
386                  }
387                }
388              },
389              "loc": {
390                "start": {
391                  "line": 21,
392                  "column": 5
393                },
394                "end": {
395                  "line": 21,
396                  "column": 34
397                }
398              }
399            },
400            {
401              "type": "RestElement",
402              "argument": {
403                "type": "Identifier",
404                "name": "d",
405                "decorators": [],
406                "loc": {
407                  "start": {
408                    "line": 21,
409                    "column": 39
410                  },
411                  "end": {
412                    "line": 21,
413                    "column": 40
414                  }
415                }
416              },
417              "loc": {
418                "start": {
419                  "line": 21,
420                  "column": 36
421                },
422                "end": {
423                  "line": 21,
424                  "column": 40
425                }
426              }
427            }
428          ],
429          "loc": {
430            "start": {
431              "line": 21,
432              "column": 1
433            },
434            "end": {
435              "line": 21,
436              "column": 41
437            }
438          }
439        },
440        "right": {
441          "type": "ArrayExpression",
442          "elements": [
443            {
444              "type": "ObjectExpression",
445              "properties": [],
446              "loc": {
447                "start": {
448                  "line": 21,
449                  "column": 45
450                },
451                "end": {
452                  "line": 21,
453                  "column": 47
454                }
455              }
456            },
457            {
458              "type": "ArrayExpression",
459              "elements": [
460                {
461                  "type": "NumberLiteral",
462                  "value": 42,
463                  "loc": {
464                    "start": {
465                      "line": 21,
466                      "column": 50
467                    },
468                    "end": {
469                      "line": 21,
470                      "column": 52
471                    }
472                  }
473                },
474                {
475                  "type": "OmittedExpression",
476                  "loc": {
477                    "start": {
478                      "line": 21,
479                      "column": 54
480                    },
481                    "end": {
482                      "line": 21,
483                      "column": 55
484                    }
485                  }
486                },
487                {
488                  "type": "BinaryExpression",
489                  "operator": "+",
490                  "left": {
491                    "type": "StringLiteral",
492                    "value": "foo",
493                    "loc": {
494                      "start": {
495                        "line": 21,
496                        "column": 56
497                      },
498                      "end": {
499                        "line": 21,
500                        "column": 61
501                      }
502                    }
503                  },
504                  "right": {
505                    "type": "NumberLiteral",
506                    "value": 2,
507                    "loc": {
508                      "start": {
509                        "line": 21,
510                        "column": 64
511                      },
512                      "end": {
513                        "line": 21,
514                        "column": 65
515                      }
516                    }
517                  },
518                  "loc": {
519                    "start": {
520                      "line": 21,
521                      "column": 56
522                    },
523                    "end": {
524                      "line": 21,
525                      "column": 65
526                    }
527                  }
528                }
529              ],
530              "loc": {
531                "start": {
532                  "line": 21,
533                  "column": 49
534                },
535                "end": {
536                  "line": 21,
537                  "column": 66
538                }
539              }
540            }
541          ],
542          "loc": {
543            "start": {
544              "line": 21,
545              "column": 44
546            },
547            "end": {
548              "line": 21,
549              "column": 67
550            }
551          }
552        },
553        "loc": {
554          "start": {
555            "line": 21,
556            "column": 1
557          },
558          "end": {
559            "line": 21,
560            "column": 67
561          }
562        }
563      },
564      "loc": {
565        "start": {
566          "line": 21,
567          "column": 1
568        },
569        "end": {
570          "line": 21,
571          "column": 68
572        }
573      }
574    }
575  ],
576  "loc": {
577    "start": {
578      "line": 1,
579      "column": 1
580    },
581    "end": {
582      "line": 21,
583      "column": 68
584    }
585  }
586}
587TypeError: Type 'number | string' is not assignable to type 'number'. [arrayDestructuring37.ts:21:6]
588