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