1{ 2 "type": "Program", 3 "statements": [ 4 { 5 "type": "VariableDeclaration", 6 "declarations": [ 7 { 8 "type": "VariableDeclarator", 9 "id": { 10 "type": "Identifier", 11 "name": "func", 12 "typeAnnotation": { 13 "type": "TSTypeLiteral", 14 "members": [ 15 { 16 "type": "TSCallSignatureDeclaration", 17 "params": [ 18 { 19 "type": "Identifier", 20 "name": "a", 21 "typeAnnotation": { 22 "type": "TSNumberKeyword", 23 "loc": { 24 "start": { 25 "line": 17, 26 "column": 17 27 }, 28 "end": { 29 "line": 17, 30 "column": 23 31 } 32 } 33 }, 34 "decorators": [], 35 "loc": { 36 "start": { 37 "line": 17, 38 "column": 14 39 }, 40 "end": { 41 "line": 17, 42 "column": 15 43 } 44 } 45 }, 46 { 47 "type": "Identifier", 48 "name": "b", 49 "typeAnnotation": { 50 "type": "TSStringKeyword", 51 "loc": { 52 "start": { 53 "line": 17, 54 "column": 28 55 }, 56 "end": { 57 "line": 17, 58 "column": 34 59 } 60 } 61 }, 62 "decorators": [], 63 "loc": { 64 "start": { 65 "line": 17, 66 "column": 25 67 }, 68 "end": { 69 "line": 17, 70 "column": 26 71 } 72 } 73 } 74 ], 75 "returnType": { 76 "type": "TSNumberKeyword", 77 "loc": { 78 "start": { 79 "line": 17, 80 "column": 37 81 }, 82 "end": { 83 "line": 17, 84 "column": 43 85 } 86 } 87 }, 88 "loc": { 89 "start": { 90 "line": 17, 91 "column": 13 92 }, 93 "end": { 94 "line": 17, 95 "column": 44 96 } 97 } 98 }, 99 { 100 "type": "TSCallSignatureDeclaration", 101 "params": [ 102 { 103 "type": "Identifier", 104 "name": "a", 105 "typeAnnotation": { 106 "type": "TSStringKeyword", 107 "loc": { 108 "start": { 109 "line": 17, 110 "column": 49 111 }, 112 "end": { 113 "line": 17, 114 "column": 55 115 } 116 } 117 }, 118 "decorators": [], 119 "loc": { 120 "start": { 121 "line": 17, 122 "column": 46 123 }, 124 "end": { 125 "line": 17, 126 "column": 47 127 } 128 } 129 }, 130 { 131 "type": "Identifier", 132 "name": "b", 133 "typeAnnotation": { 134 "type": "TSNumberKeyword", 135 "loc": { 136 "start": { 137 "line": 17, 138 "column": 61 139 }, 140 "end": { 141 "line": 17, 142 "column": 67 143 } 144 } 145 }, 146 "optional": true, 147 "decorators": [], 148 "loc": { 149 "start": { 150 "line": 17, 151 "column": 57 152 }, 153 "end": { 154 "line": 17, 155 "column": 58 156 } 157 } 158 } 159 ], 160 "returnType": { 161 "type": "TSStringKeyword", 162 "loc": { 163 "start": { 164 "line": 17, 165 "column": 70 166 }, 167 "end": { 168 "line": 17, 169 "column": 76 170 } 171 } 172 }, 173 "loc": { 174 "start": { 175 "line": 17, 176 "column": 45 177 }, 178 "end": { 179 "line": 17, 180 "column": 78 181 } 182 } 183 } 184 ], 185 "loc": { 186 "start": { 187 "line": 17, 188 "column": 11 189 }, 190 "end": { 191 "line": 17, 192 "column": 78 193 } 194 } 195 }, 196 "decorators": [], 197 "loc": { 198 "start": { 199 "line": 17, 200 "column": 5 201 }, 202 "end": { 203 "line": 17, 204 "column": 9 205 } 206 } 207 }, 208 "init": null, 209 "loc": { 210 "start": { 211 "line": 17, 212 "column": 5 213 }, 214 "end": { 215 "line": 17, 216 "column": 9 217 } 218 } 219 } 220 ], 221 "kind": "var", 222 "loc": { 223 "start": { 224 "line": 17, 225 "column": 1 226 }, 227 "end": { 228 "line": 17, 229 "column": 79 230 } 231 } 232 }, 233 { 234 "type": "VariableDeclaration", 235 "declarations": [ 236 { 237 "type": "VariableDeclarator", 238 "id": { 239 "type": "Identifier", 240 "name": "a", 241 "typeAnnotation": { 242 "type": "TSStringKeyword", 243 "loc": { 244 "start": { 245 "line": 18, 246 "column": 8 247 }, 248 "end": { 249 "line": 18, 250 "column": 14 251 } 252 } 253 }, 254 "decorators": [], 255 "loc": { 256 "start": { 257 "line": 18, 258 "column": 5 259 }, 260 "end": { 261 "line": 18, 262 "column": 6 263 } 264 } 265 }, 266 "init": { 267 "type": "CallExpression", 268 "callee": { 269 "type": "Identifier", 270 "name": "func", 271 "decorators": [], 272 "loc": { 273 "start": { 274 "line": 18, 275 "column": 17 276 }, 277 "end": { 278 "line": 18, 279 "column": 21 280 } 281 } 282 }, 283 "arguments": [ 284 { 285 "type": "NumberLiteral", 286 "value": 1, 287 "loc": { 288 "start": { 289 "line": 18, 290 "column": 22 291 }, 292 "end": { 293 "line": 18, 294 "column": 23 295 } 296 } 297 }, 298 { 299 "type": "StringLiteral", 300 "value": "foo", 301 "loc": { 302 "start": { 303 "line": 18, 304 "column": 25 305 }, 306 "end": { 307 "line": 18, 308 "column": 30 309 } 310 } 311 } 312 ], 313 "optional": false, 314 "loc": { 315 "start": { 316 "line": 18, 317 "column": 17 318 }, 319 "end": { 320 "line": 18, 321 "column": 31 322 } 323 } 324 }, 325 "loc": { 326 "start": { 327 "line": 18, 328 "column": 5 329 }, 330 "end": { 331 "line": 18, 332 "column": 31 333 } 334 } 335 } 336 ], 337 "kind": "var", 338 "loc": { 339 "start": { 340 "line": 18, 341 "column": 1 342 }, 343 "end": { 344 "line": 18, 345 "column": 32 346 } 347 } 348 } 349 ], 350 "loc": { 351 "start": { 352 "line": 1, 353 "column": 1 354 }, 355 "end": { 356 "line": 18, 357 "column": 32 358 } 359 } 360} 361TypeError: Type 'number' is not assignable to type 'string'. [functionCall_12.ts:18:5] 362