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": "TSUnionType", 14 "types": [ 15 { 16 "type": "TSTypeLiteral", 17 "members": [ 18 { 19 "type": "TSPropertySignature", 20 "computed": false, 21 "optional": false, 22 "readonly": false, 23 "key": { 24 "type": "Identifier", 25 "name": "a", 26 "decorators": [], 27 "loc": { 28 "start": { 29 "line": 17, 30 "column": 10 31 }, 32 "end": { 33 "line": 17, 34 "column": 11 35 } 36 } 37 }, 38 "typeAnnotation": { 39 "type": "TSTypeLiteral", 40 "members": [ 41 { 42 "type": "TSPropertySignature", 43 "computed": false, 44 "optional": false, 45 "readonly": false, 46 "key": { 47 "type": "Identifier", 48 "name": "a", 49 "decorators": [], 50 "loc": { 51 "start": { 52 "line": 17, 53 "column": 15 54 }, 55 "end": { 56 "line": 17, 57 "column": 16 58 } 59 } 60 }, 61 "typeAnnotation": { 62 "type": "TSNumberKeyword", 63 "loc": { 64 "start": { 65 "line": 17, 66 "column": 18 67 }, 68 "end": { 69 "line": 17, 70 "column": 24 71 } 72 } 73 }, 74 "loc": { 75 "start": { 76 "line": 17, 77 "column": 15 78 }, 79 "end": { 80 "line": 17, 81 "column": 25 82 } 83 } 84 }, 85 { 86 "type": "TSPropertySignature", 87 "computed": false, 88 "optional": false, 89 "readonly": false, 90 "key": { 91 "type": "Identifier", 92 "name": "b", 93 "decorators": [], 94 "loc": { 95 "start": { 96 "line": 17, 97 "column": 26 98 }, 99 "end": { 100 "line": 17, 101 "column": 27 102 } 103 } 104 }, 105 "typeAnnotation": { 106 "type": "TSArrayType", 107 "elementType": { 108 "type": "TSStringKeyword", 109 "loc": { 110 "start": { 111 "line": 17, 112 "column": 29 113 }, 114 "end": { 115 "line": 17, 116 "column": 35 117 } 118 } 119 }, 120 "loc": { 121 "start": { 122 "line": 17, 123 "column": 29 124 }, 125 "end": { 126 "line": 17, 127 "column": 37 128 } 129 } 130 }, 131 "loc": { 132 "start": { 133 "line": 17, 134 "column": 26 135 }, 136 "end": { 137 "line": 17, 138 "column": 39 139 } 140 } 141 } 142 ], 143 "loc": { 144 "start": { 145 "line": 17, 146 "column": 13 147 }, 148 "end": { 149 "line": 17, 150 "column": 39 151 } 152 } 153 }, 154 "loc": { 155 "start": { 156 "line": 17, 157 "column": 10 158 }, 159 "end": { 160 "line": 17, 161 "column": 41 162 } 163 } 164 } 165 ], 166 "loc": { 167 "start": { 168 "line": 17, 169 "column": 8 170 }, 171 "end": { 172 "line": 17, 173 "column": 41 174 } 175 } 176 }, 177 { 178 "type": "TSTypeLiteral", 179 "members": [ 180 { 181 "type": "TSPropertySignature", 182 "computed": false, 183 "optional": false, 184 "readonly": false, 185 "key": { 186 "type": "Identifier", 187 "name": "a", 188 "decorators": [], 189 "loc": { 190 "start": { 191 "line": 17, 192 "column": 46 193 }, 194 "end": { 195 "line": 17, 196 "column": 47 197 } 198 } 199 }, 200 "typeAnnotation": { 201 "type": "TSTypeLiteral", 202 "members": [ 203 { 204 "type": "TSPropertySignature", 205 "computed": false, 206 "optional": false, 207 "readonly": false, 208 "key": { 209 "type": "Identifier", 210 "name": "a", 211 "decorators": [], 212 "loc": { 213 "start": { 214 "line": 17, 215 "column": 51 216 }, 217 "end": { 218 "line": 17, 219 "column": 52 220 } 221 } 222 }, 223 "typeAnnotation": { 224 "type": "TSArrayType", 225 "elementType": { 226 "type": "TSNumberKeyword", 227 "loc": { 228 "start": { 229 "line": 17, 230 "column": 54 231 }, 232 "end": { 233 "line": 17, 234 "column": 60 235 } 236 } 237 }, 238 "loc": { 239 "start": { 240 "line": 17, 241 "column": 54 242 }, 243 "end": { 244 "line": 17, 245 "column": 62 246 } 247 } 248 }, 249 "loc": { 250 "start": { 251 "line": 17, 252 "column": 51 253 }, 254 "end": { 255 "line": 17, 256 "column": 63 257 } 258 } 259 }, 260 { 261 "type": "TSPropertySignature", 262 "computed": false, 263 "optional": false, 264 "readonly": false, 265 "key": { 266 "type": "Identifier", 267 "name": "b", 268 "decorators": [], 269 "loc": { 270 "start": { 271 "line": 17, 272 "column": 64 273 }, 274 "end": { 275 "line": 17, 276 "column": 65 277 } 278 } 279 }, 280 "typeAnnotation": { 281 "type": "TSNumberKeyword", 282 "loc": { 283 "start": { 284 "line": 17, 285 "column": 67 286 }, 287 "end": { 288 "line": 17, 289 "column": 73 290 } 291 } 292 }, 293 "loc": { 294 "start": { 295 "line": 17, 296 "column": 64 297 }, 298 "end": { 299 "line": 17, 300 "column": 75 301 } 302 } 303 } 304 ], 305 "loc": { 306 "start": { 307 "line": 17, 308 "column": 49 309 }, 310 "end": { 311 "line": 17, 312 "column": 75 313 } 314 } 315 }, 316 "loc": { 317 "start": { 318 "line": 17, 319 "column": 46 320 }, 321 "end": { 322 "line": 17, 323 "column": 77 324 } 325 } 326 } 327 ], 328 "loc": { 329 "start": { 330 "line": 17, 331 "column": 44 332 }, 333 "end": { 334 "line": 17, 335 "column": 77 336 } 337 } 338 } 339 ], 340 "loc": { 341 "start": { 342 "line": 17, 343 "column": 8 344 }, 345 "end": { 346 "line": 17, 347 "column": 77 348 } 349 } 350 }, 351 "decorators": [], 352 "loc": { 353 "start": { 354 "line": 17, 355 "column": 5 356 }, 357 "end": { 358 "line": 17, 359 "column": 6 360 } 361 } 362 }, 363 "init": { 364 "type": "ObjectExpression", 365 "properties": [ 366 { 367 "type": "Property", 368 "method": false, 369 "shorthand": false, 370 "computed": false, 371 "key": { 372 "type": "Identifier", 373 "name": "a", 374 "decorators": [], 375 "loc": { 376 "start": { 377 "line": 17, 378 "column": 82 379 }, 380 "end": { 381 "line": 17, 382 "column": 83 383 } 384 } 385 }, 386 "value": { 387 "type": "ObjectExpression", 388 "properties": [ 389 { 390 "type": "Property", 391 "method": false, 392 "shorthand": false, 393 "computed": false, 394 "key": { 395 "type": "Identifier", 396 "name": "a", 397 "decorators": [], 398 "loc": { 399 "start": { 400 "line": 17, 401 "column": 87 402 }, 403 "end": { 404 "line": 17, 405 "column": 88 406 } 407 } 408 }, 409 "value": { 410 "type": "ArrayExpression", 411 "elements": [ 412 { 413 "type": "NumberLiteral", 414 "value": 1, 415 "loc": { 416 "start": { 417 "line": 17, 418 "column": 91 419 }, 420 "end": { 421 "line": 17, 422 "column": 92 423 } 424 } 425 }, 426 { 427 "type": "NumberLiteral", 428 "value": 2, 429 "loc": { 430 "start": { 431 "line": 17, 432 "column": 94 433 }, 434 "end": { 435 "line": 17, 436 "column": 95 437 } 438 } 439 }, 440 { 441 "type": "NumberLiteral", 442 "value": 3, 443 "loc": { 444 "start": { 445 "line": 17, 446 "column": 97 447 }, 448 "end": { 449 "line": 17, 450 "column": 98 451 } 452 } 453 }, 454 { 455 "type": "StringLiteral", 456 "value": "foo", 457 "loc": { 458 "start": { 459 "line": 17, 460 "column": 100 461 }, 462 "end": { 463 "line": 17, 464 "column": 105 465 } 466 } 467 } 468 ], 469 "loc": { 470 "start": { 471 "line": 17, 472 "column": 90 473 }, 474 "end": { 475 "line": 17, 476 "column": 106 477 } 478 } 479 }, 480 "kind": "init", 481 "loc": { 482 "start": { 483 "line": 17, 484 "column": 87 485 }, 486 "end": { 487 "line": 17, 488 "column": 106 489 } 490 } 491 } 492 ], 493 "loc": { 494 "start": { 495 "line": 17, 496 "column": 85 497 }, 498 "end": { 499 "line": 17, 500 "column": 108 501 } 502 } 503 }, 504 "kind": "init", 505 "loc": { 506 "start": { 507 "line": 17, 508 "column": 82 509 }, 510 "end": { 511 "line": 17, 512 "column": 108 513 } 514 } 515 } 516 ], 517 "loc": { 518 "start": { 519 "line": 17, 520 "column": 80 521 }, 522 "end": { 523 "line": 17, 524 "column": 110 525 } 526 } 527 }, 528 "loc": { 529 "start": { 530 "line": 17, 531 "column": 5 532 }, 533 "end": { 534 "line": 17, 535 "column": 110 536 } 537 } 538 } 539 ], 540 "kind": "var", 541 "loc": { 542 "start": { 543 "line": 17, 544 "column": 1 545 }, 546 "end": { 547 "line": 17, 548 "column": 110 549 } 550 } 551 } 552 ], 553 "loc": { 554 "start": { 555 "line": 1, 556 "column": 1 557 }, 558 "end": { 559 "line": 17, 560 "column": 110 561 } 562 } 563} 564TypeError: Type 'string' is not assignable to type 'number'. [objectLiteralAssignability12.ts:17:100] 565