• 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": "ArrayPattern",
11            "elements": [
12              {
13                "type": "Identifier",
14                "name": "a",
15                "decorators": [],
16                "loc": {
17                  "start": {
18                    "line": 17,
19                    "column": 6
20                  },
21                  "end": {
22                    "line": 17,
23                    "column": 7
24                  }
25                }
26              }
27            ],
28            "typeAnnotation": {
29              "type": "TSTupleType",
30              "elementTypes": [
31                {
32                  "type": "TSNumberKeyword",
33                  "loc": {
34                    "start": {
35                      "line": 17,
36                      "column": 11
37                    },
38                    "end": {
39                      "line": 17,
40                      "column": 18
41                    }
42                  }
43                },
44                {
45                  "type": "TSStringKeyword",
46                  "loc": {
47                    "start": {
48                      "line": 17,
49                      "column": 19
50                    },
51                    "end": {
52                      "line": 17,
53                      "column": 26
54                    }
55                  }
56                }
57              ],
58              "loc": {
59                "start": {
60                  "line": 17,
61                  "column": 10
62                },
63                "end": {
64                  "line": 17,
65                  "column": 26
66                }
67              }
68            },
69            "loc": {
70              "start": {
71                "line": 17,
72                "column": 5
73              },
74              "end": {
75                "line": 17,
76                "column": 8
77              }
78            }
79          },
80          "init": {
81            "type": "ArrayExpression",
82            "elements": [
83              {
84                "type": "NumberLiteral",
85                "value": 1,
86                "loc": {
87                  "start": {
88                    "line": 17,
89                    "column": 30
90                  },
91                  "end": {
92                    "line": 17,
93                    "column": 31
94                  }
95                }
96              }
97            ],
98            "loc": {
99              "start": {
100                "line": 17,
101                "column": 29
102              },
103              "end": {
104                "line": 17,
105                "column": 32
106              }
107            }
108          },
109          "loc": {
110            "start": {
111              "line": 17,
112              "column": 5
113            },
114            "end": {
115              "line": 17,
116              "column": 32
117            }
118          }
119        }
120      ],
121      "kind": "var",
122      "loc": {
123        "start": {
124          "line": 17,
125          "column": 1
126        },
127        "end": {
128          "line": 17,
129          "column": 33
130        }
131      }
132    }
133  ],
134  "loc": {
135    "start": {
136      "line": 1,
137      "column": 1
138    },
139    "end": {
140      "line": 17,
141      "column": 33
142    }
143  }
144}
145TypeError: Type '[1]' is not assignable to type '[number, string]'. [arrayDestructuring4.ts:17:5]
146