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