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