{ "type": "Program", "statements": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "a", "typeAnnotation": { "type": "TSTupleType", "elementTypes": [ { "type": "TSNamedTupleMember", "elementType": { "type": "TSTupleType", "elementTypes": [ { "type": "TSNamedTupleMember", "elementType": { "type": "TSNumberKeyword", "loc": { "start": { "line": 16, "column": 17 }, "end": { "line": 16, "column": 23 } } }, "label": { "type": "Identifier", "name": "a", "decorators": [], "loc": { "start": { "line": 16, "column": 14 }, "end": { "line": 16, "column": 15 } } }, "loc": { "start": { "line": 16, "column": 14 }, "end": { "line": 16, "column": 24 } } }, { "type": "TSNamedTupleMember", "elementType": { "type": "TSNumberKeyword", "loc": { "start": { "line": 16, "column": 29 }, "end": { "line": 16, "column": 35 } } }, "label": { "type": "Identifier", "name": "b", "decorators": [], "loc": { "start": { "line": 16, "column": 25 }, "end": { "line": 16, "column": 26 } } }, "optional": true, "loc": { "start": { "line": 16, "column": 25 }, "end": { "line": 16, "column": 36 } } } ], "loc": { "start": { "line": 16, "column": 13 }, "end": { "line": 16, "column": 36 } } }, "label": { "type": "Identifier", "name": "a", "decorators": [], "loc": { "start": { "line": 16, "column": 9 }, "end": { "line": 16, "column": 10 } } }, "optional": true, "loc": { "start": { "line": 16, "column": 9 }, "end": { "line": 16, "column": 37 } } }, { "type": "TSNamedTupleMember", "elementType": { "type": "TSTupleType", "elementTypes": [ { "type": "TSUnionType", "types": [ { "type": "TSNumberKeyword", "loc": { "start": { "line": 16, "column": 43 }, "end": { "line": 16, "column": 49 } } }, { "type": "TSStringKeyword", "loc": { "start": { "line": 16, "column": 52 }, "end": { "line": 16, "column": 58 } } } ], "loc": { "start": { "line": 16, "column": 43 }, "end": { "line": 16, "column": 59 } } } ], "loc": { "start": { "line": 16, "column": 42 }, "end": { "line": 16, "column": 59 } } }, "label": { "type": "Identifier", "name": "b", "decorators": [], "loc": { "start": { "line": 16, "column": 38 }, "end": { "line": 16, "column": 39 } } }, "optional": true, "loc": { "start": { "line": 16, "column": 38 }, "end": { "line": 16, "column": 60 } } }, { "type": "TSNamedTupleMember", "elementType": { "type": "TSTypeQuery", "exprName": { "type": "Identifier", "name": "b", "decorators": [], "loc": { "start": { "line": 16, "column": 72 }, "end": { "line": 16, "column": 73 } } }, "loc": { "start": { "line": 16, "column": 65 }, "end": { "line": 16, "column": 73 } } }, "label": { "type": "Identifier", "name": "c", "decorators": [], "loc": { "start": { "line": 16, "column": 61 }, "end": { "line": 16, "column": 62 } } }, "optional": true, "loc": { "start": { "line": 16, "column": 61 }, "end": { "line": 16, "column": 74 } } } ], "loc": { "start": { "line": 16, "column": 8 }, "end": { "line": 16, "column": 74 } } }, "decorators": [], "loc": { "start": { "line": 16, "column": 5 }, "end": { "line": 16, "column": 6 } } }, "init": { "type": "ArrayExpression", "elements": [ { "type": "ArrayExpression", "elements": [ { "type": "NumberLiteral", "value": 2, "loc": { "start": { "line": 16, "column": 79 }, "end": { "line": 16, "column": 80 } } } ], "loc": { "start": { "line": 16, "column": 78 }, "end": { "line": 16, "column": 81 } } }, { "type": "CallExpression", "callee": { "type": "Identifier", "name": "func", "decorators": [], "loc": { "start": { "line": 16, "column": 83 }, "end": { "line": 16, "column": 87 } } }, "arguments": [ { "type": "NumberLiteral", "value": 5, "loc": { "start": { "line": 16, "column": 88 }, "end": { "line": 16, "column": 89 } } }, { "type": "StringLiteral", "value": "foo", "loc": { "start": { "line": 16, "column": 91 }, "end": { "line": 16, "column": 96 } } } ], "optional": false, "loc": { "start": { "line": 16, "column": 83 }, "end": { "line": 16, "column": 97 } } }, { "type": "ArrayExpression", "elements": [ { "type": "ArrayExpression", "elements": [ { "type": "NumberLiteral", "value": 1, "loc": { "start": { "line": 16, "column": 101 }, "end": { "line": 16, "column": 102 } } } ], "loc": { "start": { "line": 16, "column": 100 }, "end": { "line": 16, "column": 103 } } } ], "loc": { "start": { "line": 16, "column": 99 }, "end": { "line": 16, "column": 104 } } } ], "loc": { "start": { "line": 16, "column": 77 }, "end": { "line": 16, "column": 105 } } }, "loc": { "start": { "line": 16, "column": 5 }, "end": { "line": 16, "column": 105 } } } ], "kind": "var", "loc": { "start": { "line": 16, "column": 1 }, "end": { "line": 16, "column": 106 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "b", "typeAnnotation": { "type": "TSTupleType", "elementTypes": [ { "type": "TSTupleType", "elementTypes": [ { "type": "TSTupleType", "elementTypes": [ { "type": "TSNumberKeyword", "loc": { "start": { "line": 17, "column": 11 }, "end": { "line": 17, "column": 18 } } } ], "loc": { "start": { "line": 17, "column": 10 }, "end": { "line": 17, "column": 19 } } } ], "loc": { "start": { "line": 17, "column": 9 }, "end": { "line": 17, "column": 20 } } } ], "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 20 } } }, "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": 21 } } }, { "type": "FunctionDeclaration", "function": { "type": "ScriptFunction", "id": { "type": "Identifier", "name": "func", "decorators": [], "loc": { "start": { "line": 19, "column": 10 }, "end": { "line": 19, "column": 14 } } }, "generator": false, "async": false, "expression": false, "params": [ { "type": "Identifier", "name": "c", "typeAnnotation": { "type": "TSNumberKeyword", "loc": { "start": { "line": 19, "column": 18 }, "end": { "line": 19, "column": 24 } } }, "decorators": [], "loc": { "start": { "line": 19, "column": 15 }, "end": { "line": 19, "column": 16 } } }, { "type": "Identifier", "name": "d", "typeAnnotation": { "type": "TSStringKeyword", "loc": { "start": { "line": 19, "column": 29 }, "end": { "line": 19, "column": 35 } } }, "decorators": [], "loc": { "start": { "line": 19, "column": 26 }, "end": { "line": 19, "column": 27 } } } ], "returnType": { "type": "TSTupleType", "elementTypes": [ { "type": "TSNumberKeyword", "loc": { "start": { "line": 19, "column": 39 }, "end": { "line": 19, "column": 46 } } } ], "loc": { "start": { "line": 19, "column": 38 }, "end": { "line": 19, "column": 46 } } }, "body": { "type": "BlockStatement", "statements": [ { "type": "ReturnStatement", "argument": { "type": "ArrayExpression", "elements": [ { "type": "NumberLiteral", "value": 1, "loc": { "start": { "line": 20, "column": 13 }, "end": { "line": 20, "column": 14 } } } ], "loc": { "start": { "line": 20, "column": 12 }, "end": { "line": 20, "column": 15 } } }, "loc": { "start": { "line": 20, "column": 5 }, "end": { "line": 20, "column": 16 } } } ], "loc": { "start": { "line": 19, "column": 47 }, "end": { "line": 21, "column": 2 } } }, "loc": { "start": { "line": 19, "column": 1 }, "end": { "line": 21, "column": 2 } } }, "loc": { "start": { "line": 19, "column": 1 }, "end": { "line": 21, "column": 2 } } } ], "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 21, "column": 2 } } } TypeError: Type 'number' is not assignable to type '[number]'. [tupleAssignability18.ts:16:101]