• 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": 17,
17                  "column": 8
18                },
19                "end": {
20                  "line": 17,
21                  "column": 14
22                }
23              }
24            },
25            "decorators": [],
26            "loc": {
27              "start": {
28                "line": 17,
29                "column": 5
30              },
31              "end": {
32                "line": 17,
33                "column": 6
34              }
35            }
36          },
37          "init": null,
38          "loc": {
39            "start": {
40              "line": 17,
41              "column": 5
42            },
43            "end": {
44              "line": 17,
45              "column": 6
46            }
47          }
48        }
49      ],
50      "kind": "var",
51      "loc": {
52        "start": {
53          "line": 17,
54          "column": 1
55        },
56        "end": {
57          "line": 17,
58          "column": 15
59        }
60      }
61    },
62    {
63      "type": "ExpressionStatement",
64      "expression": {
65        "type": "AssignmentExpression",
66        "operator": "=",
67        "left": {
68          "type": "ArrayPattern",
69          "elements": [
70            {
71              "type": "ArrayPattern",
72              "elements": [
73                {
74                  "type": "Identifier",
75                  "name": "a",
76                  "decorators": [],
77                  "loc": {
78                    "start": {
79                      "line": 18,
80                      "column": 3
81                    },
82                    "end": {
83                      "line": 18,
84                      "column": 4
85                    }
86                  }
87                }
88              ],
89              "loc": {
90                "start": {
91                  "line": 18,
92                  "column": 2
93                },
94                "end": {
95                  "line": 18,
96                  "column": 5
97                }
98              }
99            }
100          ],
101          "loc": {
102            "start": {
103              "line": 18,
104              "column": 1
105            },
106            "end": {
107              "line": 18,
108              "column": 6
109            }
110          }
111        },
112        "right": {
113          "type": "ArrayExpression",
114          "elements": [
115            {
116              "type": "ArrayExpression",
117              "elements": [
118                {
119                  "type": "StringLiteral",
120                  "value": "foo",
121                  "loc": {
122                    "start": {
123                      "line": 18,
124                      "column": 11
125                    },
126                    "end": {
127                      "line": 18,
128                      "column": 16
129                    }
130                  }
131                }
132              ],
133              "loc": {
134                "start": {
135                  "line": 18,
136                  "column": 10
137                },
138                "end": {
139                  "line": 18,
140                  "column": 17
141                }
142              }
143            }
144          ],
145          "loc": {
146            "start": {
147              "line": 18,
148              "column": 9
149            },
150            "end": {
151              "line": 18,
152              "column": 18
153            }
154          }
155        },
156        "loc": {
157          "start": {
158            "line": 18,
159            "column": 1
160          },
161          "end": {
162            "line": 18,
163            "column": 18
164          }
165        }
166      },
167      "loc": {
168        "start": {
169          "line": 18,
170          "column": 1
171        },
172        "end": {
173          "line": 18,
174          "column": 19
175        }
176      }
177    }
178  ],
179  "loc": {
180    "start": {
181      "line": 1,
182      "column": 1
183    },
184    "end": {
185      "line": 18,
186      "column": 19
187    }
188  }
189}
190TypeError: Type 'string' is not assignable to type 'number'. [arrayDestructuring40.ts:18:3]
191