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