• 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                  "type": "TSNumberKeyword",
43                  "loc": {
44                    "start": {
45                      "line": 17,
46                      "column": 25
47                    },
48                    "end": {
49                      "line": 17,
50                      "column": 32
51                    }
52                  }
53                }
54              ],
55              "loc": {
56                "start": {
57                  "line": 17,
58                  "column": 8
59                },
60                "end": {
61                  "line": 17,
62                  "column": 32
63                }
64              }
65            },
66            "decorators": [],
67            "loc": {
68              "start": {
69                "line": 17,
70                "column": 5
71              },
72              "end": {
73                "line": 17,
74                "column": 6
75              }
76            }
77          },
78          "init": null,
79          "loc": {
80            "start": {
81              "line": 17,
82              "column": 5
83            },
84            "end": {
85              "line": 17,
86              "column": 6
87            }
88          }
89        }
90      ],
91      "kind": "var",
92      "loc": {
93        "start": {
94          "line": 17,
95          "column": 1
96        },
97        "end": {
98          "line": 17,
99          "column": 33
100        }
101      }
102    },
103    {
104      "type": "VariableDeclaration",
105      "declarations": [
106        {
107          "type": "VariableDeclarator",
108          "id": {
109            "type": "Identifier",
110            "name": "a",
111            "typeAnnotation": {
112              "type": "TSTupleType",
113              "elementTypes": [
114                {
115                  "type": "TSNamedTupleMember",
116                  "elementType": {
117                    "type": "TSNumberKeyword",
118                    "loc": {
119                      "start": {
120                        "line": 18,
121                        "column": 12
122                      },
123                      "end": {
124                        "line": 18,
125                        "column": 18
126                      }
127                    }
128                  },
129                  "label": {
130                    "type": "Identifier",
131                    "name": "a",
132                    "decorators": [],
133                    "loc": {
134                      "start": {
135                        "line": 18,
136                        "column": 9
137                      },
138                      "end": {
139                        "line": 18,
140                        "column": 10
141                      }
142                    }
143                  },
144                  "loc": {
145                    "start": {
146                      "line": 18,
147                      "column": 9
148                    },
149                    "end": {
150                      "line": 18,
151                      "column": 19
152                    }
153                  }
154                },
155                {
156                  "type": "TSNamedTupleMember",
157                  "elementType": {
158                    "type": "TSStringKeyword",
159                    "loc": {
160                      "start": {
161                        "line": 18,
162                        "column": 23
163                      },
164                      "end": {
165                        "line": 18,
166                        "column": 29
167                      }
168                    }
169                  },
170                  "label": {
171                    "type": "Identifier",
172                    "name": "b",
173                    "decorators": [],
174                    "loc": {
175                      "start": {
176                        "line": 18,
177                        "column": 20
178                      },
179                      "end": {
180                        "line": 18,
181                        "column": 21
182                      }
183                    }
184                  },
185                  "loc": {
186                    "start": {
187                      "line": 18,
188                      "column": 20
189                    },
190                    "end": {
191                      "line": 18,
192                      "column": 30
193                    }
194                  }
195                },
196                {
197                  "type": "TSNamedTupleMember",
198                  "elementType": {
199                    "type": "TSNumberKeyword",
200                    "loc": {
201                      "start": {
202                        "line": 18,
203                        "column": 35
204                      },
205                      "end": {
206                        "line": 18,
207                        "column": 41
208                      }
209                    }
210                  },
211                  "label": {
212                    "type": "Identifier",
213                    "name": "c",
214                    "decorators": [],
215                    "loc": {
216                      "start": {
217                        "line": 18,
218                        "column": 31
219                      },
220                      "end": {
221                        "line": 18,
222                        "column": 32
223                      }
224                    }
225                  },
226                  "optional": true,
227                  "loc": {
228                    "start": {
229                      "line": 18,
230                      "column": 31
231                    },
232                    "end": {
233                      "line": 18,
234                      "column": 42
235                    }
236                  }
237                }
238              ],
239              "loc": {
240                "start": {
241                  "line": 18,
242                  "column": 8
243                },
244                "end": {
245                  "line": 18,
246                  "column": 42
247                }
248              }
249            },
250            "decorators": [],
251            "loc": {
252              "start": {
253                "line": 18,
254                "column": 5
255              },
256              "end": {
257                "line": 18,
258                "column": 6
259              }
260            }
261          },
262          "init": null,
263          "loc": {
264            "start": {
265              "line": 18,
266              "column": 5
267            },
268            "end": {
269              "line": 18,
270              "column": 6
271            }
272          }
273        }
274      ],
275      "kind": "var",
276      "loc": {
277        "start": {
278          "line": 18,
279          "column": 1
280        },
281        "end": {
282          "line": 18,
283          "column": 43
284        }
285      }
286    }
287  ],
288  "loc": {
289    "start": {
290      "line": 1,
291      "column": 1
292    },
293    "end": {
294      "line": 18,
295      "column": 43
296    }
297  }
298}
299TypeError: Subsequent variable declaration must have the same type. Variable 'a' must be of type '[number, string, number]', but here has type '[a: number, b: string, c?: number]'. [varRedeclaration6.ts:18:5]
300