• 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": "TSNumberKeyword",
14              "loc": {
15                "start": {
16                  "line": 17,
17                  "column": 8
18                },
19                "end": {
20                  "line": 17,
21                  "column": 14
22                }
23              }
24            },
25            "decorators": [],
26            "loc": {
27              "start": {
28                "line": 17,
29                "column": 5
30              },
31              "end": {
32                "line": 17,
33                "column": 6
34              }
35            }
36          },
37          "init": null,
38          "loc": {
39            "start": {
40              "line": 17,
41              "column": 5
42            },
43            "end": {
44              "line": 17,
45              "column": 6
46            }
47          }
48        }
49      ],
50      "kind": "var",
51      "loc": {
52        "start": {
53          "line": 17,
54          "column": 1
55        },
56        "end": {
57          "line": 17,
58          "column": 15
59        }
60      }
61    },
62    {
63      "type": "VariableDeclaration",
64      "declarations": [
65        {
66          "type": "VariableDeclarator",
67          "id": {
68            "type": "Identifier",
69            "name": "a",
70            "typeAnnotation": {
71              "type": "TSLiteralType",
72              "literal": {
73                "type": "NumberLiteral",
74                "value": 5,
75                "loc": {
76                  "start": {
77                    "line": 18,
78                    "column": 8
79                  },
80                  "end": {
81                    "line": 18,
82                    "column": 9
83                  }
84                }
85              },
86              "loc": {
87                "start": {
88                  "line": 18,
89                  "column": 8
90                },
91                "end": {
92                  "line": 18,
93                  "column": 9
94                }
95              }
96            },
97            "decorators": [],
98            "loc": {
99              "start": {
100                "line": 18,
101                "column": 5
102              },
103              "end": {
104                "line": 18,
105                "column": 6
106              }
107            }
108          },
109          "init": null,
110          "loc": {
111            "start": {
112              "line": 18,
113              "column": 5
114            },
115            "end": {
116              "line": 18,
117              "column": 6
118            }
119          }
120        }
121      ],
122      "kind": "var",
123      "loc": {
124        "start": {
125          "line": 18,
126          "column": 1
127        },
128        "end": {
129          "line": 18,
130          "column": 10
131        }
132      }
133    }
134  ],
135  "loc": {
136    "start": {
137      "line": 1,
138      "column": 1
139    },
140    "end": {
141      "line": 18,
142      "column": 10
143    }
144  }
145}
146TypeError: Subsequent variable declaration must have the same type. Variable 'a' must be of type 'number', but here has type '5'. [varRedeclaration2.ts:18:5]
147