• 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            "typeAnnotation": {
99              "type": "TSTupleType",
100              "elementTypes": [
101                {
102                  "type": "TSStringKeyword",
103                  "loc": {
104                    "start": {
105                      "line": 18,
106                      "column": 9
107                    },
108                    "end": {
109                      "line": 18,
110                      "column": 16
111                    }
112                  }
113                },
114                {
115                  "type": "TSNumberKeyword",
116                  "loc": {
117                    "start": {
118                      "line": 18,
119                      "column": 17
120                    },
121                    "end": {
122                      "line": 18,
123                      "column": 24
124                    }
125                  }
126                }
127              ],
128              "loc": {
129                "start": {
130                  "line": 18,
131                  "column": 8
132                },
133                "end": {
134                  "line": 18,
135                  "column": 24
136                }
137              }
138            },
139            "decorators": [],
140            "loc": {
141              "start": {
142                "line": 18,
143                "column": 5
144              },
145              "end": {
146                "line": 18,
147                "column": 6
148              }
149            }
150          },
151          "init": null,
152          "loc": {
153            "start": {
154              "line": 18,
155              "column": 5
156            },
157            "end": {
158              "line": 18,
159              "column": 6
160            }
161          }
162        }
163      ],
164      "kind": "var",
165      "loc": {
166        "start": {
167          "line": 18,
168          "column": 1
169        },
170        "end": {
171          "line": 18,
172          "column": 25
173        }
174      }
175    },
176    {
177      "type": "ExpressionStatement",
178      "expression": {
179        "type": "AssignmentExpression",
180        "operator": "=",
181        "left": {
182          "type": "Identifier",
183          "name": "a",
184          "decorators": [],
185          "loc": {
186            "start": {
187              "line": 19,
188              "column": 1
189            },
190            "end": {
191              "line": 19,
192              "column": 2
193            }
194          }
195        },
196        "right": {
197          "type": "Identifier",
198          "name": "b",
199          "decorators": [],
200          "loc": {
201            "start": {
202              "line": 19,
203              "column": 5
204            },
205            "end": {
206              "line": 19,
207              "column": 6
208            }
209          }
210        },
211        "loc": {
212          "start": {
213            "line": 19,
214            "column": 1
215          },
216          "end": {
217            "line": 19,
218            "column": 6
219          }
220        }
221      },
222      "loc": {
223        "start": {
224          "line": 19,
225          "column": 1
226        },
227        "end": {
228          "line": 19,
229          "column": 7
230        }
231      }
232    }
233  ],
234  "loc": {
235    "start": {
236      "line": 1,
237      "column": 1
238    },
239    "end": {
240      "line": 19,
241      "column": 7
242    }
243  }
244}
245TypeError: Type '[string, number]' is not assignable to type '[number, string]'. [tupleAssignability4.ts:19:1]
246