• 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": "NumberLiteral",
256                    "value": 2,
257                    "loc": {
258                      "start": {
259                        "line": 17,
260                        "column": 73
261                      },
262                      "end": {
263                        "line": 17,
264                        "column": 74
265                      }
266                    }
267                  },
268                  {
269                    "type": "ArrayExpression",
270                    "elements": [
271                      {
272                        "type": "NumberLiteral",
273                        "value": 3,
274                        "loc": {
275                          "start": {
276                            "line": 17,
277                            "column": 77
278                          },
279                          "end": {
280                            "line": 17,
281                            "column": 78
282                          }
283                        }
284                      },
285                      {
286                        "type": "NumberLiteral",
287                        "value": 4,
288                        "loc": {
289                          "start": {
290                            "line": 17,
291                            "column": 80
292                          },
293                          "end": {
294                            "line": 17,
295                            "column": 81
296                          }
297                        }
298                      }
299                    ],
300                    "loc": {
301                      "start": {
302                        "line": 17,
303                        "column": 76
304                      },
305                      "end": {
306                        "line": 17,
307                        "column": 82
308                      }
309                    }
310                  }
311                ],
312                "loc": {
313                  "start": {
314                    "line": 17,
315                    "column": 72
316                  },
317                  "end": {
318                    "line": 17,
319                    "column": 83
320                  }
321                }
322              }
323            ],
324            "loc": {
325              "start": {
326                "line": 17,
327                "column": 66
328              },
329              "end": {
330                "line": 17,
331                "column": 84
332              }
333            }
334          },
335          "loc": {
336            "start": {
337              "line": 17,
338              "column": 5
339            },
340            "end": {
341              "line": 17,
342              "column": 84
343            }
344          }
345        }
346      ],
347      "kind": "var",
348      "loc": {
349        "start": {
350          "line": 17,
351          "column": 1
352        },
353        "end": {
354          "line": 17,
355          "column": 85
356        }
357      }
358    }
359  ],
360  "loc": {
361    "start": {
362      "line": 1,
363      "column": 1
364    },
365    "end": {
366      "line": 17,
367      "column": 85
368    }
369  }
370}
371TypeError: Type 'number' is not assignable to type 'boolean | string'. [tupleAssignability7.ts:17:73]
372