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