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": null, 128 "loc": { 129 "start": { 130 "line": 17, 131 "column": 5 132 }, 133 "end": { 134 "line": 17, 135 "column": 6 136 } 137 } 138 } 139 ], 140 "kind": "var", 141 "loc": { 142 "start": { 143 "line": 17, 144 "column": 1 145 }, 146 "end": { 147 "line": 17, 148 "column": 33 149 } 150 } 151 }, 152 { 153 "type": "VariableDeclaration", 154 "declarations": [ 155 { 156 "type": "VariableDeclarator", 157 "id": { 158 "type": "Identifier", 159 "name": "a", 160 "typeAnnotation": { 161 "type": "TSUnionType", 162 "types": [ 163 { 164 "type": "TSTypeQuery", 165 "exprName": { 166 "type": "Identifier", 167 "name": "a", 168 "decorators": [], 169 "loc": { 170 "start": { 171 "line": 18, 172 "column": 15 173 }, 174 "end": { 175 "line": 18, 176 "column": 16 177 } 178 } 179 }, 180 "loc": { 181 "start": { 182 "line": 18, 183 "column": 8 184 }, 185 "end": { 186 "line": 18, 187 "column": 16 188 } 189 } 190 }, 191 { 192 "type": "TSLiteralType", 193 "literal": { 194 "type": "NumberLiteral", 195 "value": 5, 196 "loc": { 197 "start": { 198 "line": 18, 199 "column": 19 200 }, 201 "end": { 202 "line": 18, 203 "column": 20 204 } 205 } 206 }, 207 "loc": { 208 "start": { 209 "line": 18, 210 "column": 19 211 }, 212 "end": { 213 "line": 18, 214 "column": 20 215 } 216 } 217 } 218 ], 219 "loc": { 220 "start": { 221 "line": 18, 222 "column": 8 223 }, 224 "end": { 225 "line": 18, 226 "column": 20 227 } 228 } 229 }, 230 "decorators": [], 231 "loc": { 232 "start": { 233 "line": 18, 234 "column": 5 235 }, 236 "end": { 237 "line": 18, 238 "column": 6 239 } 240 } 241 }, 242 "init": null, 243 "loc": { 244 "start": { 245 "line": 18, 246 "column": 5 247 }, 248 "end": { 249 "line": 18, 250 "column": 6 251 } 252 } 253 } 254 ], 255 "kind": "var", 256 "loc": { 257 "start": { 258 "line": 18, 259 "column": 1 260 }, 261 "end": { 262 "line": 18, 263 "column": 21 264 } 265 } 266 } 267 ], 268 "loc": { 269 "start": { 270 "line": 1, 271 "column": 1 272 }, 273 "end": { 274 "line": 18, 275 "column": 21 276 } 277 } 278} 279TypeError: Subsequent variable declaration must have the same type. Variable 'a' must be of type '{ a: number; b: string; }', but here has type '{ a: number; b: string; } | 5'. [varRedeclaration15.ts:18:5] 280