• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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": "NumberLiteral",
456                            "value": 4,
457                            "loc": {
458                              "start": {
459                                "line": 17,
460                                "column": 100
461                              },
462                              "end": {
463                                "line": 17,
464                                "column": 101
465                              }
466                            }
467                          }
468                        ],
469                        "loc": {
470                          "start": {
471                            "line": 17,
472                            "column": 90
473                          },
474                          "end": {
475                            "line": 17,
476                            "column": 102
477                          }
478                        }
479                      },
480                      "kind": "init",
481                      "loc": {
482                        "start": {
483                          "line": 17,
484                          "column": 87
485                        },
486                        "end": {
487                          "line": 17,
488                          "column": 102
489                        }
490                      }
491                    },
492                    {
493                      "type": "Property",
494                      "method": false,
495                      "shorthand": false,
496                      "computed": false,
497                      "key": {
498                        "type": "Identifier",
499                        "name": "b",
500                        "decorators": [],
501                        "loc": {
502                          "start": {
503                            "line": 17,
504                            "column": 104
505                          },
506                          "end": {
507                            "line": 17,
508                            "column": 105
509                          }
510                        }
511                      },
512                      "value": {
513                        "type": "NumberLiteral",
514                        "value": 5,
515                        "loc": {
516                          "start": {
517                            "line": 17,
518                            "column": 107
519                          },
520                          "end": {
521                            "line": 17,
522                            "column": 108
523                          }
524                        }
525                      },
526                      "kind": "init",
527                      "loc": {
528                        "start": {
529                          "line": 17,
530                          "column": 104
531                        },
532                        "end": {
533                          "line": 17,
534                          "column": 108
535                        }
536                      }
537                    },
538                    {
539                      "type": "Property",
540                      "method": false,
541                      "shorthand": false,
542                      "computed": false,
543                      "key": {
544                        "type": "Identifier",
545                        "name": "c",
546                        "decorators": [],
547                        "loc": {
548                          "start": {
549                            "line": 17,
550                            "column": 110
551                          },
552                          "end": {
553                            "line": 17,
554                            "column": 111
555                          }
556                        }
557                      },
558                      "value": {
559                        "type": "StringLiteral",
560                        "value": "foo",
561                        "loc": {
562                          "start": {
563                            "line": 17,
564                            "column": 113
565                          },
566                          "end": {
567                            "line": 17,
568                            "column": 118
569                          }
570                        }
571                      },
572                      "kind": "init",
573                      "loc": {
574                        "start": {
575                          "line": 17,
576                          "column": 110
577                        },
578                        "end": {
579                          "line": 17,
580                          "column": 118
581                        }
582                      }
583                    }
584                  ],
585                  "loc": {
586                    "start": {
587                      "line": 17,
588                      "column": 85
589                    },
590                    "end": {
591                      "line": 17,
592                      "column": 120
593                    }
594                  }
595                },
596                "kind": "init",
597                "loc": {
598                  "start": {
599                    "line": 17,
600                    "column": 82
601                  },
602                  "end": {
603                    "line": 17,
604                    "column": 120
605                  }
606                }
607              }
608            ],
609            "loc": {
610              "start": {
611                "line": 17,
612                "column": 80
613              },
614              "end": {
615                "line": 17,
616                "column": 122
617              }
618            }
619          },
620          "loc": {
621            "start": {
622              "line": 17,
623              "column": 5
624            },
625            "end": {
626              "line": 17,
627              "column": 122
628            }
629          }
630        }
631      ],
632      "kind": "var",
633      "loc": {
634        "start": {
635          "line": 17,
636          "column": 1
637        },
638        "end": {
639          "line": 17,
640          "column": 122
641        }
642      }
643    }
644  ],
645  "loc": {
646    "start": {
647      "line": 1,
648      "column": 1
649    },
650    "end": {
651      "line": 17,
652      "column": 122
653    }
654  }
655}
656TypeError: Object literal may only specify known properties, and "c" does not exist in type '{ a: number; b: string[]; } | { a: number[]; b: number; }'. [objectLiteralAssignability14.ts:17:110]
657