{ "type": "Program", "statements": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "a", "typeAnnotation": { "type": "TSTupleType", "elementTypes": [ { "type": "TSNamedTupleMember", "elementType": { "type": "TSNumberKeyword", "loc": { "start": { "line": 17, "column": 12 }, "end": { "line": 17, "column": 18 } } }, "label": { "type": "Identifier", "name": "a", "decorators": [], "loc": { "start": { "line": 17, "column": 9 }, "end": { "line": 17, "column": 10 } } }, "loc": { "start": { "line": 17, "column": 9 }, "end": { "line": 17, "column": 19 } } }, { "type": "TSNamedTupleMember", "elementType": { "type": "TSStringKeyword", "loc": { "start": { "line": 17, "column": 23 }, "end": { "line": 17, "column": 29 } } }, "label": { "type": "Identifier", "name": "b", "decorators": [], "loc": { "start": { "line": 17, "column": 20 }, "end": { "line": 17, "column": 21 } } }, "loc": { "start": { "line": 17, "column": 20 }, "end": { "line": 17, "column": 30 } } }, { "type": "TSNamedTupleMember", "elementType": { "type": "TSNumberKeyword", "loc": { "start": { "line": 17, "column": 35 }, "end": { "line": 17, "column": 41 } } }, "label": { "type": "Identifier", "name": "c", "decorators": [], "loc": { "start": { "line": 17, "column": 31 }, "end": { "line": 17, "column": 32 } } }, "optional": true, "loc": { "start": { "line": 17, "column": 31 }, "end": { "line": 17, "column": 42 } } } ], "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 42 } } }, "decorators": [], "loc": { "start": { "line": 17, "column": 5 }, "end": { "line": 17, "column": 6 } } }, "init": null, "loc": { "start": { "line": 17, "column": 5 }, "end": { "line": 17, "column": 6 } } } ], "kind": "var", "loc": { "start": { "line": 17, "column": 1 }, "end": { "line": 17, "column": 43 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "b", "typeAnnotation": { "type": "TSTupleType", "elementTypes": [ { "type": "TSNamedTupleMember", "elementType": { "type": "TSNumberKeyword", "loc": { "start": { "line": 18, "column": 12 }, "end": { "line": 18, "column": 18 } } }, "label": { "type": "Identifier", "name": "a", "decorators": [], "loc": { "start": { "line": 18, "column": 9 }, "end": { "line": 18, "column": 10 } } }, "loc": { "start": { "line": 18, "column": 9 }, "end": { "line": 18, "column": 19 } } }, { "type": "TSNamedTupleMember", "elementType": { "type": "TSStringKeyword", "loc": { "start": { "line": 18, "column": 23 }, "end": { "line": 18, "column": 29 } } }, "label": { "type": "Identifier", "name": "b", "decorators": [], "loc": { "start": { "line": 18, "column": 20 }, "end": { "line": 18, "column": 21 } } }, "loc": { "start": { "line": 18, "column": 20 }, "end": { "line": 18, "column": 30 } } }, { "type": "TSNamedTupleMember", "elementType": { "type": "TSNumberKeyword", "loc": { "start": { "line": 18, "column": 34 }, "end": { "line": 18, "column": 40 } } }, "label": { "type": "Identifier", "name": "c", "decorators": [], "loc": { "start": { "line": 18, "column": 31 }, "end": { "line": 18, "column": 32 } } }, "loc": { "start": { "line": 18, "column": 31 }, "end": { "line": 18, "column": 41 } } }, { "type": "TSNamedTupleMember", "elementType": { "type": "TSNumberKeyword", "loc": { "start": { "line": 18, "column": 45 }, "end": { "line": 18, "column": 51 } } }, "label": { "type": "Identifier", "name": "d", "decorators": [], "loc": { "start": { "line": 18, "column": 42 }, "end": { "line": 18, "column": 43 } } }, "loc": { "start": { "line": 18, "column": 42 }, "end": { "line": 18, "column": 52 } } } ], "loc": { "start": { "line": 18, "column": 8 }, "end": { "line": 18, "column": 52 } } }, "decorators": [], "loc": { "start": { "line": 18, "column": 5 }, "end": { "line": 18, "column": 6 } } }, "init": null, "loc": { "start": { "line": 18, "column": 5 }, "end": { "line": 18, "column": 6 } } } ], "kind": "var", "loc": { "start": { "line": 18, "column": 1 }, "end": { "line": 18, "column": 53 } } }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "Identifier", "name": "a", "decorators": [], "loc": { "start": { "line": 19, "column": 1 }, "end": { "line": 19, "column": 2 } } }, "right": { "type": "Identifier", "name": "b", "decorators": [], "loc": { "start": { "line": 19, "column": 5 }, "end": { "line": 19, "column": 6 } } }, "loc": { "start": { "line": 19, "column": 1 }, "end": { "line": 19, "column": 6 } } }, "loc": { "start": { "line": 19, "column": 1 }, "end": { "line": 19, "column": 7 } } } ], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 19, "column": 7 } } } TypeError: Type '[a: number, b: string, c: number, d: number]' is not assignable to type '[a: number, b: string, c?: number]'. [tupleAssignability12.ts:19:1]