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