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