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