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": "TSUnionType", 159 "types": [ 160 { 161 "type": "TSNumberKeyword", 162 "loc": { 163 "start": { 164 "line": 17, 165 "column": 28 166 }, 167 "end": { 168 "line": 17, 169 "column": 34 170 } 171 } 172 }, 173 { 174 "type": "TSStringKeyword", 175 "loc": { 176 "start": { 177 "line": 17, 178 "column": 37 179 }, 180 "end": { 181 "line": 17, 182 "column": 43 183 } 184 } 185 } 186 ], 187 "loc": { 188 "start": { 189 "line": 17, 190 "column": 28 191 }, 192 "end": { 193 "line": 17, 194 "column": 43 195 } 196 } 197 }, 198 "loc": { 199 "start": { 200 "line": 17, 201 "column": 25 202 }, 203 "end": { 204 "line": 17, 205 "column": 44 206 } 207 } 208 }, 209 { 210 "type": "TSPropertySignature", 211 "computed": false, 212 "optional": false, 213 "readonly": false, 214 "key": { 215 "type": "Identifier", 216 "name": "b", 217 "decorators": [], 218 "loc": { 219 "start": { 220 "line": 17, 221 "column": 45 222 }, 223 "end": { 224 "line": 17, 225 "column": 46 226 } 227 } 228 }, 229 "typeAnnotation": { 230 "type": "TSNumberKeyword", 231 "loc": { 232 "start": { 233 "line": 17, 234 "column": 48 235 }, 236 "end": { 237 "line": 17, 238 "column": 54 239 } 240 } 241 }, 242 "loc": { 243 "start": { 244 "line": 17, 245 "column": 45 246 }, 247 "end": { 248 "line": 17, 249 "column": 56 250 } 251 } 252 } 253 ], 254 "loc": { 255 "start": { 256 "line": 17, 257 "column": 23 258 }, 259 "end": { 260 "line": 17, 261 "column": 56 262 } 263 } 264 }, 265 "loc": { 266 "start": { 267 "line": 17, 268 "column": 5 269 }, 270 "end": { 271 "line": 17, 272 "column": 21 273 } 274 } 275 }, 276 "init": { 277 "type": "ObjectExpression", 278 "properties": [ 279 { 280 "type": "Property", 281 "method": false, 282 "shorthand": false, 283 "computed": false, 284 "key": { 285 "type": "Identifier", 286 "name": "a", 287 "decorators": [], 288 "loc": { 289 "start": { 290 "line": 17, 291 "column": 61 292 }, 293 "end": { 294 "line": 17, 295 "column": 62 296 } 297 } 298 }, 299 "value": { 300 "type": "NumberLiteral", 301 "value": 12, 302 "loc": { 303 "start": { 304 "line": 17, 305 "column": 64 306 }, 307 "end": { 308 "line": 17, 309 "column": 66 310 } 311 } 312 }, 313 "kind": "init", 314 "loc": { 315 "start": { 316 "line": 17, 317 "column": 61 318 }, 319 "end": { 320 "line": 17, 321 "column": 66 322 } 323 } 324 }, 325 { 326 "type": "Property", 327 "method": false, 328 "shorthand": false, 329 "computed": false, 330 "key": { 331 "type": "Identifier", 332 "name": "b", 333 "decorators": [], 334 "loc": { 335 "start": { 336 "line": 17, 337 "column": 68 338 }, 339 "end": { 340 "line": 17, 341 "column": 69 342 } 343 } 344 }, 345 "value": { 346 "type": "BooleanLiteral", 347 "value": true, 348 "loc": { 349 "start": { 350 "line": 17, 351 "column": 71 352 }, 353 "end": { 354 "line": 17, 355 "column": 75 356 } 357 } 358 }, 359 "kind": "init", 360 "loc": { 361 "start": { 362 "line": 17, 363 "column": 68 364 }, 365 "end": { 366 "line": 17, 367 "column": 75 368 } 369 } 370 } 371 ], 372 "loc": { 373 "start": { 374 "line": 17, 375 "column": 59 376 }, 377 "end": { 378 "line": 17, 379 "column": 77 380 } 381 } 382 }, 383 "loc": { 384 "start": { 385 "line": 17, 386 "column": 5 387 }, 388 "end": { 389 "line": 17, 390 "column": 77 391 } 392 } 393 } 394 ], 395 "kind": "var", 396 "loc": { 397 "start": { 398 "line": 17, 399 "column": 1 400 }, 401 "end": { 402 "line": 17, 403 "column": 78 404 } 405 } 406 } 407 ], 408 "loc": { 409 "start": { 410 "line": 1, 411 "column": 1 412 }, 413 "end": { 414 "line": 17, 415 "column": 78 416 } 417 } 418} 419TypeError: Type 'boolean' is not assignable to type 'number'. [objectDestructuring17.ts:17:68] 420