• 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": "NumberLiteral",
388                  "value": 5,
389                  "loc": {
390                    "start": {
391                      "line": 17,
392                      "column": 85
393                    },
394                    "end": {
395                      "line": 17,
396                      "column": 86
397                    }
398                  }
399                },
400                "kind": "init",
401                "loc": {
402                  "start": {
403                    "line": 17,
404                    "column": 82
405                  },
406                  "end": {
407                    "line": 17,
408                    "column": 86
409                  }
410                }
411              }
412            ],
413            "loc": {
414              "start": {
415                "line": 17,
416                "column": 80
417              },
418              "end": {
419                "line": 17,
420                "column": 88
421              }
422            }
423          },
424          "loc": {
425            "start": {
426              "line": 17,
427              "column": 5
428            },
429            "end": {
430              "line": 17,
431              "column": 88
432            }
433          }
434        }
435      ],
436      "kind": "var",
437      "loc": {
438        "start": {
439          "line": 17,
440          "column": 1
441        },
442        "end": {
443          "line": 17,
444          "column": 88
445        }
446      }
447    }
448  ],
449  "loc": {
450    "start": {
451      "line": 1,
452      "column": 1
453    },
454    "end": {
455      "line": 17,
456      "column": 88
457    }
458  }
459}
460TypeError: Type 'number' is not assignable to type '{ a: number; b: string[]; } | { a: number[]; b: number; }'. [objectLiteralAssignability11.ts:17:82]
461