• 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": {
128            "type": "ObjectExpression",
129            "properties": [
130              {
131                "type": "Property",
132                "method": false,
133                "shorthand": false,
134                "computed": false,
135                "key": {
136                  "type": "Identifier",
137                  "name": "a",
138                  "decorators": [],
139                  "loc": {
140                    "start": {
141                      "line": 17,
142                      "column": 37
143                    },
144                    "end": {
145                      "line": 17,
146                      "column": 38
147                    }
148                  }
149                },
150                "value": {
151                  "type": "StringLiteral",
152                  "value": "foo",
153                  "loc": {
154                    "start": {
155                      "line": 17,
156                      "column": 40
157                    },
158                    "end": {
159                      "line": 17,
160                      "column": 45
161                    }
162                  }
163                },
164                "kind": "init",
165                "loc": {
166                  "start": {
167                    "line": 17,
168                    "column": 37
169                  },
170                  "end": {
171                    "line": 17,
172                    "column": 45
173                  }
174                }
175              },
176              {
177                "type": "Property",
178                "method": false,
179                "shorthand": false,
180                "computed": false,
181                "key": {
182                  "type": "Identifier",
183                  "name": "b",
184                  "decorators": [],
185                  "loc": {
186                    "start": {
187                      "line": 17,
188                      "column": 47
189                    },
190                    "end": {
191                      "line": 17,
192                      "column": 48
193                    }
194                  }
195                },
196                "value": {
197                  "type": "StringLiteral",
198                  "value": "bar",
199                  "loc": {
200                    "start": {
201                      "line": 17,
202                      "column": 50
203                    },
204                    "end": {
205                      "line": 17,
206                      "column": 55
207                    }
208                  }
209                },
210                "kind": "init",
211                "loc": {
212                  "start": {
213                    "line": 17,
214                    "column": 47
215                  },
216                  "end": {
217                    "line": 17,
218                    "column": 55
219                  }
220                }
221              }
222            ],
223            "loc": {
224              "start": {
225                "line": 17,
226                "column": 35
227              },
228              "end": {
229                "line": 17,
230                "column": 57
231              }
232            }
233          },
234          "loc": {
235            "start": {
236              "line": 17,
237              "column": 5
238            },
239            "end": {
240              "line": 17,
241              "column": 57
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": 58
255        }
256      }
257    }
258  ],
259  "loc": {
260    "start": {
261      "line": 1,
262      "column": 1
263    },
264    "end": {
265      "line": 17,
266      "column": 58
267    }
268  }
269}
270TypeError: Type 'string' is not assignable to type 'number'. [objectLiteralAssignability1.ts:17:37]
271