• 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": "TSUnionType",
72              "types": [
73                {
74                  "type": "TSNumberKeyword",
75                  "loc": {
76                    "start": {
77                      "line": 18,
78                      "column": 8
79                    },
80                    "end": {
81                      "line": 18,
82                      "column": 14
83                    }
84                  }
85                },
86                {
87                  "type": "TSStringKeyword",
88                  "loc": {
89                    "start": {
90                      "line": 18,
91                      "column": 17
92                    },
93                    "end": {
94                      "line": 18,
95                      "column": 23
96                    }
97                  }
98                }
99              ],
100              "loc": {
101                "start": {
102                  "line": 18,
103                  "column": 8
104                },
105                "end": {
106                  "line": 18,
107                  "column": 23
108                }
109              }
110            },
111            "decorators": [],
112            "loc": {
113              "start": {
114                "line": 18,
115                "column": 5
116              },
117              "end": {
118                "line": 18,
119                "column": 6
120              }
121            }
122          },
123          "init": null,
124          "loc": {
125            "start": {
126              "line": 18,
127              "column": 5
128            },
129            "end": {
130              "line": 18,
131              "column": 6
132            }
133          }
134        }
135      ],
136      "kind": "var",
137      "loc": {
138        "start": {
139          "line": 18,
140          "column": 1
141        },
142        "end": {
143          "line": 18,
144          "column": 24
145        }
146      }
147    }
148  ],
149  "loc": {
150    "start": {
151      "line": 1,
152      "column": 1
153    },
154    "end": {
155      "line": 18,
156      "column": 24
157    }
158  }
159}
160TypeError: Subsequent variable declaration must have the same type. Variable 'a' must be of type 'number', but here has type 'number | string'. [varRedeclaration3.ts:18:5]
161