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