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