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": "TSTupleType", 14 "elementTypes": [ 15 { 16 "type": "TSNamedTupleMember", 17 "elementType": { 18 "type": "TSNumberKeyword", 19 "loc": { 20 "start": { 21 "line": 17, 22 "column": 12 23 }, 24 "end": { 25 "line": 17, 26 "column": 18 27 } 28 } 29 }, 30 "label": { 31 "type": "Identifier", 32 "name": "a", 33 "decorators": [], 34 "loc": { 35 "start": { 36 "line": 17, 37 "column": 9 38 }, 39 "end": { 40 "line": 17, 41 "column": 10 42 } 43 } 44 }, 45 "loc": { 46 "start": { 47 "line": 17, 48 "column": 9 49 }, 50 "end": { 51 "line": 17, 52 "column": 19 53 } 54 } 55 }, 56 { 57 "type": "TSNamedTupleMember", 58 "elementType": { 59 "type": "TSStringKeyword", 60 "loc": { 61 "start": { 62 "line": 17, 63 "column": 23 64 }, 65 "end": { 66 "line": 17, 67 "column": 29 68 } 69 } 70 }, 71 "label": { 72 "type": "Identifier", 73 "name": "b", 74 "decorators": [], 75 "loc": { 76 "start": { 77 "line": 17, 78 "column": 20 79 }, 80 "end": { 81 "line": 17, 82 "column": 21 83 } 84 } 85 }, 86 "loc": { 87 "start": { 88 "line": 17, 89 "column": 20 90 }, 91 "end": { 92 "line": 17, 93 "column": 30 94 } 95 } 96 }, 97 { 98 "type": "TSNamedTupleMember", 99 "elementType": { 100 "type": "TSNumberKeyword", 101 "loc": { 102 "start": { 103 "line": 17, 104 "column": 35 105 }, 106 "end": { 107 "line": 17, 108 "column": 41 109 } 110 } 111 }, 112 "label": { 113 "type": "Identifier", 114 "name": "c", 115 "decorators": [], 116 "loc": { 117 "start": { 118 "line": 17, 119 "column": 31 120 }, 121 "end": { 122 "line": 17, 123 "column": 32 124 } 125 } 126 }, 127 "optional": true, 128 "loc": { 129 "start": { 130 "line": 17, 131 "column": 31 132 }, 133 "end": { 134 "line": 17, 135 "column": 42 136 } 137 } 138 } 139 ], 140 "loc": { 141 "start": { 142 "line": 17, 143 "column": 8 144 }, 145 "end": { 146 "line": 17, 147 "column": 42 148 } 149 } 150 }, 151 "decorators": [], 152 "loc": { 153 "start": { 154 "line": 17, 155 "column": 5 156 }, 157 "end": { 158 "line": 17, 159 "column": 6 160 } 161 } 162 }, 163 "init": null, 164 "loc": { 165 "start": { 166 "line": 17, 167 "column": 5 168 }, 169 "end": { 170 "line": 17, 171 "column": 6 172 } 173 } 174 } 175 ], 176 "kind": "var", 177 "loc": { 178 "start": { 179 "line": 17, 180 "column": 1 181 }, 182 "end": { 183 "line": 17, 184 "column": 43 185 } 186 } 187 }, 188 { 189 "type": "VariableDeclaration", 190 "declarations": [ 191 { 192 "type": "VariableDeclarator", 193 "id": { 194 "type": "Identifier", 195 "name": "b", 196 "typeAnnotation": { 197 "type": "TSTupleType", 198 "elementTypes": [ 199 { 200 "type": "TSNamedTupleMember", 201 "elementType": { 202 "type": "TSNumberKeyword", 203 "loc": { 204 "start": { 205 "line": 18, 206 "column": 12 207 }, 208 "end": { 209 "line": 18, 210 "column": 18 211 } 212 } 213 }, 214 "label": { 215 "type": "Identifier", 216 "name": "a", 217 "decorators": [], 218 "loc": { 219 "start": { 220 "line": 18, 221 "column": 9 222 }, 223 "end": { 224 "line": 18, 225 "column": 10 226 } 227 } 228 }, 229 "loc": { 230 "start": { 231 "line": 18, 232 "column": 9 233 }, 234 "end": { 235 "line": 18, 236 "column": 19 237 } 238 } 239 }, 240 { 241 "type": "TSNamedTupleMember", 242 "elementType": { 243 "type": "TSStringKeyword", 244 "loc": { 245 "start": { 246 "line": 18, 247 "column": 23 248 }, 249 "end": { 250 "line": 18, 251 "column": 29 252 } 253 } 254 }, 255 "label": { 256 "type": "Identifier", 257 "name": "b", 258 "decorators": [], 259 "loc": { 260 "start": { 261 "line": 18, 262 "column": 20 263 }, 264 "end": { 265 "line": 18, 266 "column": 21 267 } 268 } 269 }, 270 "loc": { 271 "start": { 272 "line": 18, 273 "column": 20 274 }, 275 "end": { 276 "line": 18, 277 "column": 30 278 } 279 } 280 }, 281 { 282 "type": "TSNamedTupleMember", 283 "elementType": { 284 "type": "TSNumberKeyword", 285 "loc": { 286 "start": { 287 "line": 18, 288 "column": 34 289 }, 290 "end": { 291 "line": 18, 292 "column": 40 293 } 294 } 295 }, 296 "label": { 297 "type": "Identifier", 298 "name": "c", 299 "decorators": [], 300 "loc": { 301 "start": { 302 "line": 18, 303 "column": 31 304 }, 305 "end": { 306 "line": 18, 307 "column": 32 308 } 309 } 310 }, 311 "loc": { 312 "start": { 313 "line": 18, 314 "column": 31 315 }, 316 "end": { 317 "line": 18, 318 "column": 41 319 } 320 } 321 }, 322 { 323 "type": "TSNamedTupleMember", 324 "elementType": { 325 "type": "TSNumberKeyword", 326 "loc": { 327 "start": { 328 "line": 18, 329 "column": 45 330 }, 331 "end": { 332 "line": 18, 333 "column": 51 334 } 335 } 336 }, 337 "label": { 338 "type": "Identifier", 339 "name": "d", 340 "decorators": [], 341 "loc": { 342 "start": { 343 "line": 18, 344 "column": 42 345 }, 346 "end": { 347 "line": 18, 348 "column": 43 349 } 350 } 351 }, 352 "loc": { 353 "start": { 354 "line": 18, 355 "column": 42 356 }, 357 "end": { 358 "line": 18, 359 "column": 52 360 } 361 } 362 } 363 ], 364 "loc": { 365 "start": { 366 "line": 18, 367 "column": 8 368 }, 369 "end": { 370 "line": 18, 371 "column": 52 372 } 373 } 374 }, 375 "decorators": [], 376 "loc": { 377 "start": { 378 "line": 18, 379 "column": 5 380 }, 381 "end": { 382 "line": 18, 383 "column": 6 384 } 385 } 386 }, 387 "init": null, 388 "loc": { 389 "start": { 390 "line": 18, 391 "column": 5 392 }, 393 "end": { 394 "line": 18, 395 "column": 6 396 } 397 } 398 } 399 ], 400 "kind": "var", 401 "loc": { 402 "start": { 403 "line": 18, 404 "column": 1 405 }, 406 "end": { 407 "line": 18, 408 "column": 53 409 } 410 } 411 }, 412 { 413 "type": "ExpressionStatement", 414 "expression": { 415 "type": "AssignmentExpression", 416 "operator": "=", 417 "left": { 418 "type": "Identifier", 419 "name": "a", 420 "decorators": [], 421 "loc": { 422 "start": { 423 "line": 19, 424 "column": 1 425 }, 426 "end": { 427 "line": 19, 428 "column": 2 429 } 430 } 431 }, 432 "right": { 433 "type": "Identifier", 434 "name": "b", 435 "decorators": [], 436 "loc": { 437 "start": { 438 "line": 19, 439 "column": 5 440 }, 441 "end": { 442 "line": 19, 443 "column": 6 444 } 445 } 446 }, 447 "loc": { 448 "start": { 449 "line": 19, 450 "column": 1 451 }, 452 "end": { 453 "line": 19, 454 "column": 6 455 } 456 } 457 }, 458 "loc": { 459 "start": { 460 "line": 19, 461 "column": 1 462 }, 463 "end": { 464 "line": 19, 465 "column": 7 466 } 467 } 468 } 469 ], 470 "loc": { 471 "start": { 472 "line": 1, 473 "column": 1 474 }, 475 "end": { 476 "line": 19, 477 "column": 7 478 } 479 } 480} 481TypeError: Type '[a: number, b: string, c: number, d: number]' is not assignable to type '[a: number, b: string, c?: number]'. [tupleAssignability12.ts:19:1] 482