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