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 "loc": { 19 "start": { 20 "line": 17, 21 "column": 8 22 }, 23 "end": { 24 "line": 17, 25 "column": 10 26 } 27 } 28 }, 29 { 30 "type": "TSTypeLiteral", 31 "members": [ 32 { 33 "type": "TSPropertySignature", 34 "computed": false, 35 "optional": false, 36 "readonly": false, 37 "key": { 38 "type": "Identifier", 39 "name": "a", 40 "decorators": [], 41 "loc": { 42 "start": { 43 "line": 17, 44 "column": 15 45 }, 46 "end": { 47 "line": 17, 48 "column": 16 49 } 50 } 51 }, 52 "typeAnnotation": { 53 "type": "TSNumberKeyword", 54 "loc": { 55 "start": { 56 "line": 17, 57 "column": 18 58 }, 59 "end": { 60 "line": 17, 61 "column": 24 62 } 63 } 64 }, 65 "loc": { 66 "start": { 67 "line": 17, 68 "column": 15 69 }, 70 "end": { 71 "line": 17, 72 "column": 25 73 } 74 } 75 }, 76 { 77 "type": "TSPropertySignature", 78 "computed": false, 79 "optional": false, 80 "readonly": false, 81 "key": { 82 "type": "Identifier", 83 "name": "b", 84 "decorators": [], 85 "loc": { 86 "start": { 87 "line": 17, 88 "column": 26 89 }, 90 "end": { 91 "line": 17, 92 "column": 27 93 } 94 } 95 }, 96 "typeAnnotation": { 97 "type": "TSStringKeyword", 98 "loc": { 99 "start": { 100 "line": 17, 101 "column": 29 102 }, 103 "end": { 104 "line": 17, 105 "column": 35 106 } 107 } 108 }, 109 "loc": { 110 "start": { 111 "line": 17, 112 "column": 26 113 }, 114 "end": { 115 "line": 17, 116 "column": 37 117 } 118 } 119 } 120 ], 121 "loc": { 122 "start": { 123 "line": 17, 124 "column": 13 125 }, 126 "end": { 127 "line": 17, 128 "column": 37 129 } 130 } 131 }, 132 { 133 "type": "TSNumberKeyword", 134 "loc": { 135 "start": { 136 "line": 17, 137 "column": 40 138 }, 139 "end": { 140 "line": 17, 141 "column": 46 142 } 143 } 144 } 145 ], 146 "loc": { 147 "start": { 148 "line": 17, 149 "column": 8 150 }, 151 "end": { 152 "line": 17, 153 "column": 46 154 } 155 } 156 }, 157 "decorators": [], 158 "loc": { 159 "start": { 160 "line": 17, 161 "column": 5 162 }, 163 "end": { 164 "line": 17, 165 "column": 6 166 } 167 } 168 }, 169 "init": null, 170 "loc": { 171 "start": { 172 "line": 17, 173 "column": 5 174 }, 175 "end": { 176 "line": 17, 177 "column": 6 178 } 179 } 180 } 181 ], 182 "kind": "var", 183 "loc": { 184 "start": { 185 "line": 17, 186 "column": 1 187 }, 188 "end": { 189 "line": 17, 190 "column": 47 191 } 192 } 193 }, 194 { 195 "type": "VariableDeclaration", 196 "declarations": [ 197 { 198 "type": "VariableDeclarator", 199 "id": { 200 "type": "Identifier", 201 "name": "a", 202 "typeAnnotation": { 203 "type": "TSUnionType", 204 "types": [ 205 { 206 "type": "TSTypeLiteral", 207 "members": [ 208 { 209 "type": "TSPropertySignature", 210 "computed": false, 211 "optional": false, 212 "readonly": false, 213 "key": { 214 "type": "Identifier", 215 "name": "a", 216 "decorators": [], 217 "loc": { 218 "start": { 219 "line": 18, 220 "column": 10 221 }, 222 "end": { 223 "line": 18, 224 "column": 11 225 } 226 } 227 }, 228 "typeAnnotation": { 229 "type": "TSNumberKeyword", 230 "loc": { 231 "start": { 232 "line": 18, 233 "column": 13 234 }, 235 "end": { 236 "line": 18, 237 "column": 19 238 } 239 } 240 }, 241 "loc": { 242 "start": { 243 "line": 18, 244 "column": 10 245 }, 246 "end": { 247 "line": 18, 248 "column": 20 249 } 250 } 251 }, 252 { 253 "type": "TSPropertySignature", 254 "computed": false, 255 "optional": false, 256 "readonly": false, 257 "key": { 258 "type": "Identifier", 259 "name": "b", 260 "decorators": [], 261 "loc": { 262 "start": { 263 "line": 18, 264 "column": 21 265 }, 266 "end": { 267 "line": 18, 268 "column": 22 269 } 270 } 271 }, 272 "typeAnnotation": { 273 "type": "TSStringKeyword", 274 "loc": { 275 "start": { 276 "line": 18, 277 "column": 24 278 }, 279 "end": { 280 "line": 18, 281 "column": 30 282 } 283 } 284 }, 285 "loc": { 286 "start": { 287 "line": 18, 288 "column": 21 289 }, 290 "end": { 291 "line": 18, 292 "column": 32 293 } 294 } 295 } 296 ], 297 "loc": { 298 "start": { 299 "line": 18, 300 "column": 8 301 }, 302 "end": { 303 "line": 18, 304 "column": 32 305 } 306 } 307 }, 308 { 309 "type": "TSStringKeyword", 310 "loc": { 311 "start": { 312 "line": 18, 313 "column": 35 314 }, 315 "end": { 316 "line": 18, 317 "column": 41 318 } 319 } 320 }, 321 { 322 "type": "TSTypeLiteral", 323 "members": [], 324 "loc": { 325 "start": { 326 "line": 18, 327 "column": 44 328 }, 329 "end": { 330 "line": 18, 331 "column": 46 332 } 333 } 334 } 335 ], 336 "loc": { 337 "start": { 338 "line": 18, 339 "column": 8 340 }, 341 "end": { 342 "line": 18, 343 "column": 46 344 } 345 } 346 }, 347 "decorators": [], 348 "loc": { 349 "start": { 350 "line": 18, 351 "column": 5 352 }, 353 "end": { 354 "line": 18, 355 "column": 6 356 } 357 } 358 }, 359 "init": null, 360 "loc": { 361 "start": { 362 "line": 18, 363 "column": 5 364 }, 365 "end": { 366 "line": 18, 367 "column": 6 368 } 369 } 370 } 371 ], 372 "kind": "var", 373 "loc": { 374 "start": { 375 "line": 18, 376 "column": 1 377 }, 378 "end": { 379 "line": 18, 380 "column": 47 381 } 382 } 383 } 384 ], 385 "loc": { 386 "start": { 387 "line": 1, 388 "column": 1 389 }, 390 "end": { 391 "line": 18, 392 "column": 47 393 } 394 } 395} 396TypeError: Subsequent variable declaration must have the same type. Variable 'a' must be of type '{ } | { a: number; b: string; } | number', but here has type '{ a: number; b: string; } | string | { }'. [varRedeclaration11.ts:18:5] 397