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