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