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": "TSFunctionType", 14 "params": [ 15 { 16 "type": "Identifier", 17 "name": "a", 18 "typeAnnotation": { 19 "type": "TSNumberKeyword", 20 "loc": { 21 "start": { 22 "line": 17, 23 "column": 12 24 }, 25 "end": { 26 "line": 17, 27 "column": 18 28 } 29 } 30 }, 31 "decorators": [], 32 "loc": { 33 "start": { 34 "line": 17, 35 "column": 9 36 }, 37 "end": { 38 "line": 17, 39 "column": 10 40 } 41 } 42 }, 43 { 44 "type": "Identifier", 45 "name": "b", 46 "typeAnnotation": { 47 "type": "TSNumberKeyword", 48 "loc": { 49 "start": { 50 "line": 17, 51 "column": 24 52 }, 53 "end": { 54 "line": 17, 55 "column": 30 56 } 57 } 58 }, 59 "optional": true, 60 "decorators": [], 61 "loc": { 62 "start": { 63 "line": 17, 64 "column": 20 65 }, 66 "end": { 67 "line": 17, 68 "column": 21 69 } 70 } 71 } 72 ], 73 "returnType": { 74 "type": "TSNumberKeyword", 75 "loc": { 76 "start": { 77 "line": 17, 78 "column": 35 79 }, 80 "end": { 81 "line": 17, 82 "column": 41 83 } 84 } 85 }, 86 "loc": { 87 "start": { 88 "line": 17, 89 "column": 8 90 }, 91 "end": { 92 "line": 17, 93 "column": 41 94 } 95 } 96 }, 97 "decorators": [], 98 "loc": { 99 "start": { 100 "line": 17, 101 "column": 5 102 }, 103 "end": { 104 "line": 17, 105 "column": 6 106 } 107 } 108 }, 109 "init": null, 110 "loc": { 111 "start": { 112 "line": 17, 113 "column": 5 114 }, 115 "end": { 116 "line": 17, 117 "column": 6 118 } 119 } 120 } 121 ], 122 "kind": "var", 123 "loc": { 124 "start": { 125 "line": 17, 126 "column": 1 127 }, 128 "end": { 129 "line": 17, 130 "column": 42 131 } 132 } 133 }, 134 { 135 "type": "VariableDeclaration", 136 "declarations": [ 137 { 138 "type": "VariableDeclarator", 139 "id": { 140 "type": "Identifier", 141 "name": "a", 142 "typeAnnotation": { 143 "type": "TSFunctionType", 144 "params": [ 145 { 146 "type": "Identifier", 147 "name": "a", 148 "typeAnnotation": { 149 "type": "TSNumberKeyword", 150 "loc": { 151 "start": { 152 "line": 18, 153 "column": 12 154 }, 155 "end": { 156 "line": 18, 157 "column": 18 158 } 159 } 160 }, 161 "decorators": [], 162 "loc": { 163 "start": { 164 "line": 18, 165 "column": 9 166 }, 167 "end": { 168 "line": 18, 169 "column": 10 170 } 171 } 172 }, 173 { 174 "type": "Identifier", 175 "name": "b", 176 "typeAnnotation": { 177 "type": "TSNumberKeyword", 178 "loc": { 179 "start": { 180 "line": 18, 181 "column": 23 182 }, 183 "end": { 184 "line": 18, 185 "column": 29 186 } 187 } 188 }, 189 "decorators": [], 190 "loc": { 191 "start": { 192 "line": 18, 193 "column": 20 194 }, 195 "end": { 196 "line": 18, 197 "column": 21 198 } 199 } 200 } 201 ], 202 "returnType": { 203 "type": "TSNumberKeyword", 204 "loc": { 205 "start": { 206 "line": 18, 207 "column": 34 208 }, 209 "end": { 210 "line": 18, 211 "column": 40 212 } 213 } 214 }, 215 "loc": { 216 "start": { 217 "line": 18, 218 "column": 8 219 }, 220 "end": { 221 "line": 18, 222 "column": 40 223 } 224 } 225 }, 226 "decorators": [], 227 "loc": { 228 "start": { 229 "line": 18, 230 "column": 5 231 }, 232 "end": { 233 "line": 18, 234 "column": 6 235 } 236 } 237 }, 238 "init": null, 239 "loc": { 240 "start": { 241 "line": 18, 242 "column": 5 243 }, 244 "end": { 245 "line": 18, 246 "column": 6 247 } 248 } 249 } 250 ], 251 "kind": "var", 252 "loc": { 253 "start": { 254 "line": 18, 255 "column": 1 256 }, 257 "end": { 258 "line": 18, 259 "column": 41 260 } 261 } 262 } 263 ], 264 "loc": { 265 "start": { 266 "line": 1, 267 "column": 1 268 }, 269 "end": { 270 "line": 18, 271 "column": 41 272 } 273 } 274} 275TypeError: Subsequent variable declaration must have the same type. Variable 'a' must be of type '(a: number, b?: number) => number', but here has type '(a: number, b: number) => number'. [varRedeclaration9.ts:18:5] 276