• 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": "TSTypeLiteral",
37                    "members": [
38                      {
39                        "type": "TSPropertySignature",
40                        "computed": false,
41                        "optional": false,
42                        "readonly": false,
43                        "key": {
44                          "type": "Identifier",
45                          "name": "a",
46                          "decorators": [],
47                          "loc": {
48                            "start": {
49                              "line": 17,
50                              "column": 15
51                            },
52                            "end": {
53                              "line": 17,
54                              "column": 16
55                            }
56                          }
57                        },
58                        "typeAnnotation": {
59                          "type": "TSNumberKeyword",
60                          "loc": {
61                            "start": {
62                              "line": 17,
63                              "column": 18
64                            },
65                            "end": {
66                              "line": 17,
67                              "column": 24
68                            }
69                          }
70                        },
71                        "loc": {
72                          "start": {
73                            "line": 17,
74                            "column": 15
75                          },
76                          "end": {
77                            "line": 17,
78                            "column": 25
79                          }
80                        }
81                      },
82                      {
83                        "type": "TSPropertySignature",
84                        "computed": false,
85                        "optional": false,
86                        "readonly": false,
87                        "key": {
88                          "type": "Identifier",
89                          "name": "b",
90                          "decorators": [],
91                          "loc": {
92                            "start": {
93                              "line": 17,
94                              "column": 26
95                            },
96                            "end": {
97                              "line": 17,
98                              "column": 27
99                            }
100                          }
101                        },
102                        "typeAnnotation": {
103                          "type": "TSStringKeyword",
104                          "loc": {
105                            "start": {
106                              "line": 17,
107                              "column": 29
108                            },
109                            "end": {
110                              "line": 17,
111                              "column": 35
112                            }
113                          }
114                        },
115                        "loc": {
116                          "start": {
117                            "line": 17,
118                            "column": 26
119                          },
120                          "end": {
121                            "line": 17,
122                            "column": 37
123                          }
124                        }
125                      }
126                    ],
127                    "loc": {
128                      "start": {
129                        "line": 17,
130                        "column": 13
131                      },
132                      "end": {
133                        "line": 17,
134                        "column": 37
135                      }
136                    }
137                  },
138                  "loc": {
139                    "start": {
140                      "line": 17,
141                      "column": 10
142                    },
143                    "end": {
144                      "line": 17,
145                      "column": 39
146                    }
147                  }
148                }
149              ],
150              "loc": {
151                "start": {
152                  "line": 17,
153                  "column": 8
154                },
155                "end": {
156                  "line": 17,
157                  "column": 39
158                }
159              }
160            },
161            "decorators": [],
162            "loc": {
163              "start": {
164                "line": 17,
165                "column": 5
166              },
167              "end": {
168                "line": 17,
169                "column": 6
170              }
171            }
172          },
173          "init": {
174            "type": "ObjectExpression",
175            "properties": [
176              {
177                "type": "Property",
178                "method": false,
179                "shorthand": false,
180                "computed": false,
181                "key": {
182                  "type": "Identifier",
183                  "name": "a",
184                  "decorators": [],
185                  "loc": {
186                    "start": {
187                      "line": 17,
188                      "column": 44
189                    },
190                    "end": {
191                      "line": 17,
192                      "column": 45
193                    }
194                  }
195                },
196                "value": {
197                  "type": "NumberLiteral",
198                  "value": 5,
199                  "loc": {
200                    "start": {
201                      "line": 17,
202                      "column": 47
203                    },
204                    "end": {
205                      "line": 17,
206                      "column": 48
207                    }
208                  }
209                },
210                "kind": "init",
211                "loc": {
212                  "start": {
213                    "line": 17,
214                    "column": 44
215                  },
216                  "end": {
217                    "line": 17,
218                    "column": 48
219                  }
220                }
221              }
222            ],
223            "loc": {
224              "start": {
225                "line": 17,
226                "column": 42
227              },
228              "end": {
229                "line": 17,
230                "column": 50
231              }
232            }
233          },
234          "loc": {
235            "start": {
236              "line": 17,
237              "column": 5
238            },
239            "end": {
240              "line": 17,
241              "column": 50
242            }
243          }
244        }
245      ],
246      "kind": "var",
247      "loc": {
248        "start": {
249          "line": 17,
250          "column": 1
251        },
252        "end": {
253          "line": 17,
254          "column": 51
255        }
256      }
257    }
258  ],
259  "loc": {
260    "start": {
261      "line": 1,
262      "column": 1
263    },
264    "end": {
265      "line": 17,
266      "column": 51
267    }
268  }
269}
270TypeError: Type 'number' is not assignable to type '{ a: number; b: string; }'. [objectLiteralAssignability9.ts:17:44]
271