• 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": "TSArrayType",
14              "elementType": {
15                "type": "TSStringKeyword",
16                "loc": {
17                  "start": {
18                    "line": 17,
19                    "column": 8
20                  },
21                  "end": {
22                    "line": 17,
23                    "column": 14
24                  }
25                }
26              },
27              "loc": {
28                "start": {
29                  "line": 17,
30                  "column": 8
31                },
32                "end": {
33                  "line": 17,
34                  "column": 16
35                }
36              }
37            },
38            "decorators": [],
39            "loc": {
40              "start": {
41                "line": 17,
42                "column": 5
43              },
44              "end": {
45                "line": 17,
46                "column": 6
47              }
48            }
49          },
50          "init": null,
51          "loc": {
52            "start": {
53              "line": 17,
54              "column": 5
55            },
56            "end": {
57              "line": 17,
58              "column": 6
59            }
60          }
61        }
62      ],
63      "kind": "var",
64      "loc": {
65        "start": {
66          "line": 17,
67          "column": 1
68        },
69        "end": {
70          "line": 17,
71          "column": 17
72        }
73      }
74    },
75    {
76      "type": "VariableDeclaration",
77      "declarations": [
78        {
79          "type": "VariableDeclarator",
80          "id": {
81            "type": "Identifier",
82            "name": "b",
83            "typeAnnotation": {
84              "type": "TSArrayType",
85              "elementType": {
86                "type": "TSStringKeyword",
87                "loc": {
88                  "start": {
89                    "line": 18,
90                    "column": 8
91                  },
92                  "end": {
93                    "line": 18,
94                    "column": 14
95                  }
96                }
97              },
98              "loc": {
99                "start": {
100                  "line": 18,
101                  "column": 8
102                },
103                "end": {
104                  "line": 18,
105                  "column": 16
106                }
107              }
108            },
109            "decorators": [],
110            "loc": {
111              "start": {
112                "line": 18,
113                "column": 5
114              },
115              "end": {
116                "line": 18,
117                "column": 6
118              }
119            }
120          },
121          "init": null,
122          "loc": {
123            "start": {
124              "line": 18,
125              "column": 5
126            },
127            "end": {
128              "line": 18,
129              "column": 6
130            }
131          }
132        }
133      ],
134      "kind": "var",
135      "loc": {
136        "start": {
137          "line": 18,
138          "column": 1
139        },
140        "end": {
141          "line": 18,
142          "column": 17
143        }
144      }
145    },
146    {
147      "type": "ExpressionStatement",
148      "expression": {
149        "type": "AssignmentExpression",
150        "operator": "=",
151        "left": {
152          "type": "ArrayPattern",
153          "elements": [
154            {
155              "type": "ArrayPattern",
156              "elements": [
157                {
158                  "type": "RestElement",
159                  "argument": {
160                    "type": "Identifier",
161                    "name": "b",
162                    "decorators": [],
163                    "loc": {
164                      "start": {
165                        "line": 20,
166                        "column": 6
167                      },
168                      "end": {
169                        "line": 20,
170                        "column": 7
171                      }
172                    }
173                  },
174                  "loc": {
175                    "start": {
176                      "line": 20,
177                      "column": 3
178                    },
179                    "end": {
180                      "line": 20,
181                      "column": 7
182                    }
183                  }
184                }
185              ],
186              "loc": {
187                "start": {
188                  "line": 20,
189                  "column": 2
190                },
191                "end": {
192                  "line": 20,
193                  "column": 8
194                }
195              }
196            },
197            {
198              "type": "RestElement",
199              "argument": {
200                "type": "Identifier",
201                "name": "a",
202                "decorators": [],
203                "loc": {
204                  "start": {
205                    "line": 20,
206                    "column": 13
207                  },
208                  "end": {
209                    "line": 20,
210                    "column": 14
211                  }
212                }
213              },
214              "loc": {
215                "start": {
216                  "line": 20,
217                  "column": 10
218                },
219                "end": {
220                  "line": 20,
221                  "column": 14
222                }
223              }
224            }
225          ],
226          "loc": {
227            "start": {
228              "line": 20,
229              "column": 1
230            },
231            "end": {
232              "line": 20,
233              "column": 15
234            }
235          }
236        },
237        "right": {
238          "type": "ArrayExpression",
239          "elements": [
240            {
241              "type": "ArrayExpression",
242              "elements": [
243                {
244                  "type": "StringLiteral",
245                  "value": "foo",
246                  "loc": {
247                    "start": {
248                      "line": 20,
249                      "column": 20
250                    },
251                    "end": {
252                      "line": 20,
253                      "column": 25
254                    }
255                  }
256                },
257                {
258                  "type": "BooleanLiteral",
259                  "value": false,
260                  "loc": {
261                    "start": {
262                      "line": 20,
263                      "column": 27
264                    },
265                    "end": {
266                      "line": 20,
267                      "column": 32
268                    }
269                  }
270                }
271              ],
272              "loc": {
273                "start": {
274                  "line": 20,
275                  "column": 19
276                },
277                "end": {
278                  "line": 20,
279                  "column": 33
280                }
281              }
282            },
283            {
284              "type": "StringLiteral",
285              "value": "foo",
286              "loc": {
287                "start": {
288                  "line": 20,
289                  "column": 35
290                },
291                "end": {
292                  "line": 20,
293                  "column": 40
294                }
295              }
296            }
297          ],
298          "loc": {
299            "start": {
300              "line": 20,
301              "column": 18
302            },
303            "end": {
304              "line": 20,
305              "column": 41
306            }
307          }
308        },
309        "loc": {
310          "start": {
311            "line": 20,
312            "column": 1
313          },
314          "end": {
315            "line": 20,
316            "column": 41
317          }
318        }
319      },
320      "loc": {
321        "start": {
322          "line": 20,
323          "column": 1
324        },
325        "end": {
326          "line": 20,
327          "column": 41
328        }
329      }
330    }
331  ],
332  "loc": {
333    "start": {
334      "line": 1,
335      "column": 1
336    },
337    "end": {
338      "line": 20,
339      "column": 41
340    }
341  }
342}
343TypeError: Type '[string, boolean]' is not assignable to type 'string[]'. [arrayDestructuring44.ts:20:6]
344