• 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": "TSNumberKeyword",
14              "loc": {
15                "start": {
16                  "line": 16,
17                  "column": 8
18                },
19                "end": {
20                  "line": 16,
21                  "column": 14
22                }
23              }
24            },
25            "decorators": [],
26            "loc": {
27              "start": {
28                "line": 16,
29                "column": 5
30              },
31              "end": {
32                "line": 16,
33                "column": 6
34              }
35            }
36          },
37          "init": null,
38          "loc": {
39            "start": {
40              "line": 16,
41              "column": 5
42            },
43            "end": {
44              "line": 16,
45              "column": 6
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": 15
59        }
60      }
61    },
62    {
63      "type": "ExpressionStatement",
64      "expression": {
65        "type": "AssignmentExpression",
66        "operator": "=",
67        "left": {
68          "type": "ObjectPattern",
69          "properties": [
70            {
71              "type": "Property",
72              "method": false,
73              "shorthand": true,
74              "computed": false,
75              "key": {
76                "type": "Identifier",
77                "name": "a",
78                "decorators": [],
79                "loc": {
80                  "start": {
81                    "line": 17,
82                    "column": 3
83                  },
84                  "end": {
85                    "line": 17,
86                    "column": 4
87                  }
88                }
89              },
90              "value": {
91                "type": "AssignmentPattern",
92                "left": {
93                  "type": "Identifier",
94                  "name": "a",
95                  "decorators": [],
96                  "loc": {
97                    "start": {
98                      "line": 17,
99                      "column": 3
100                    },
101                    "end": {
102                      "line": 17,
103                      "column": 4
104                    }
105                  }
106                },
107                "right": {
108                  "type": "StringLiteral",
109                  "value": "foo",
110                  "loc": {
111                    "start": {
112                      "line": 17,
113                      "column": 7
114                    },
115                    "end": {
116                      "line": 17,
117                      "column": 12
118                    }
119                  }
120                },
121                "loc": {
122                  "start": {
123                    "line": 17,
124                    "column": 3
125                  },
126                  "end": {
127                    "line": 17,
128                    "column": 12
129                  }
130                }
131              },
132              "kind": "init",
133              "loc": {
134                "start": {
135                  "line": 17,
136                  "column": 3
137                },
138                "end": {
139                  "line": 17,
140                  "column": 12
141                }
142              }
143            }
144          ],
145          "loc": {
146            "start": {
147              "line": 17,
148              "column": 2
149            },
150            "end": {
151              "line": 17,
152              "column": 13
153            }
154          }
155        },
156        "right": {
157          "type": "ObjectExpression",
158          "properties": [
159            {
160              "type": "Property",
161              "method": false,
162              "shorthand": false,
163              "computed": false,
164              "key": {
165                "type": "Identifier",
166                "name": "a",
167                "decorators": [],
168                "loc": {
169                  "start": {
170                    "line": 17,
171                    "column": 17
172                  },
173                  "end": {
174                    "line": 17,
175                    "column": 18
176                  }
177                }
178              },
179              "value": {
180                "type": "NumberLiteral",
181                "value": 3,
182                "loc": {
183                  "start": {
184                    "line": 17,
185                    "column": 21
186                  },
187                  "end": {
188                    "line": 17,
189                    "column": 22
190                  }
191                }
192              },
193              "kind": "init",
194              "loc": {
195                "start": {
196                  "line": 17,
197                  "column": 17
198                },
199                "end": {
200                  "line": 17,
201                  "column": 22
202                }
203              }
204            }
205          ],
206          "loc": {
207            "start": {
208              "line": 17,
209              "column": 16
210            },
211            "end": {
212              "line": 17,
213              "column": 23
214            }
215          }
216        },
217        "loc": {
218          "start": {
219            "line": 17,
220            "column": 1
221          },
222          "end": {
223            "line": 17,
224            "column": 24
225          }
226        }
227      },
228      "loc": {
229        "start": {
230          "line": 17,
231          "column": 1
232        },
233        "end": {
234          "line": 17,
235          "column": 24
236        }
237      }
238    }
239  ],
240  "loc": {
241    "start": {
242      "line": 1,
243      "column": 1
244    },
245    "end": {
246      "line": 19,
247      "column": 1
248    }
249  }
250}
251TypeError: Type 'string' is not assignable to type 'number'. [objectDestructuring31.ts:17:3]
252