From c80c84ac60dd4604fa558a5ccf887750be965f8f Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 28 Apr 2020 13:35:02 -0700 Subject: [PATCH] Initial draft of named tuple members --- src/compiler/checker.ts | 108 ++++-- src/compiler/diagnosticMessages.json | 12 + src/compiler/emitter.ts | 16 +- src/compiler/factoryPublic.ts | 39 ++- src/compiler/parser.ts | 33 +- src/compiler/transformers/declarations.ts | 4 + src/compiler/types.ts | 15 +- src/compiler/utilities.ts | 5 +- src/compiler/visitorPublic.ts | 8 +- src/services/refactors/extractType.ts | 5 + src/testRunner/unittests/printer.ts | 4 +- ...xpressions.parsesCorrectly.tupleType0.json | 2 +- ...xpressions.parsesCorrectly.tupleType1.json | 2 +- ...xpressions.parsesCorrectly.tupleType2.json | 2 +- ...xpressions.parsesCorrectly.tupleType3.json | 2 +- ...sCorrectly.tupleTypeWithTrailingComma.json | 2 +- .../reference/api/tsserverlibrary.d.ts | 323 +++++++++--------- tests/baselines/reference/api/typescript.d.ts | 323 +++++++++--------- .../reference/genericRestParameters1.types | 8 +- .../reference/genericRestParameters2.types | 14 +- .../genericRestParameters3.errors.txt | 20 +- .../reference/genericRestTypes.errors.txt | 4 +- .../reference/genericRestTypes.types | 2 +- .../getParameterNameAtPosition.types | 2 +- .../instantiateContextualTypes.types | 2 +- ...ileCompilationRestParamJsDocFunction.types | 2 +- .../jsdocParseDotDotDotInJSDocFunction.types | 2 +- .../reference/jsdocParseStarEquals.types | 2 +- .../reference/jsdocPrefixPostfixParsing.types | 2 +- .../reference/jsdocRestParameter_es6.types | 2 +- ...WithTupleArgsHasCorrectAssignability.types | 4 +- .../baselines/reference/namedTupleMembers.js | 59 ++++ .../reference/namedTupleMembers.symbols | 49 +++ .../reference/namedTupleMembers.types | 46 +++ .../namedTupleMembersErrors.errors.txt | 27 ++ .../reference/namedTupleMembersErrors.js | 22 ++ .../reference/namedTupleMembersErrors.symbols | 16 + .../reference/namedTupleMembersErrors.types | 16 + .../reference/parameterListAsTupleType.types | 12 +- ...edFunctionInferenceWithTypeParameter.types | 2 +- .../reference/ramdaToolsNoInfinite.types | 6 +- .../restTuplesFromContextualTypes.errors.txt | 8 +- .../restTuplesFromContextualTypes.types | 18 +- .../reference/strictBindCallApply1.errors.txt | 28 +- .../types/tuple/named/namedTupleMembers.ts | 27 ++ .../tuple/named/namedTupleMembersErrors.ts | 11 + .../fourslash/contextuallyTypedParameters.ts | 8 +- tests/cases/fourslash/namedTupleMembers.ts | 5 + tests/cases/fourslash/restArgType.ts | 6 +- 49 files changed, 901 insertions(+), 436 deletions(-) create mode 100644 tests/baselines/reference/namedTupleMembers.js create mode 100644 tests/baselines/reference/namedTupleMembers.symbols create mode 100644 tests/baselines/reference/namedTupleMembers.types create mode 100644 tests/baselines/reference/namedTupleMembersErrors.errors.txt create mode 100644 tests/baselines/reference/namedTupleMembersErrors.js create mode 100644 tests/baselines/reference/namedTupleMembersErrors.symbols create mode 100644 tests/baselines/reference/namedTupleMembersErrors.types create mode 100644 tests/cases/conformance/types/tuple/named/namedTupleMembers.ts create mode 100644 tests/cases/conformance/types/tuple/named/namedTupleMembersErrors.ts create mode 100644 tests/cases/fourslash/namedTupleMembers.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 93276c42cb3a8..cf67821d20f2e 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4560,12 +4560,17 @@ namespace ts { createRestTypeNode(createArrayTypeNode(tupleConstituentNodes[i])) : createOptionalTypeNode(tupleConstituentNodes[i]); } - const tupleTypeNode = createTupleTypeNode(tupleConstituentNodes); + if ((type.target as TupleType).associatedNames) { + for (let i = 0; i < tupleConstituentNodes.length; i++) { + tupleConstituentNodes[i] = createNamedTupleMember(createIdentifier(unescapeLeadingUnderscores((type.target as TupleType).associatedNames![i])), tupleConstituentNodes[i]); + } + } + const tupleTypeNode = setEmitFlags(createTupleTypeNode(tupleConstituentNodes), EmitFlags.SingleLine); return (type.target).readonly ? createTypeOperatorNode(SyntaxKind.ReadonlyKeyword, tupleTypeNode) : tupleTypeNode; } } if (context.encounteredError || (context.flags & NodeBuilderFlags.AllowEmptyTuple)) { - const tupleTypeNode = createTupleTypeNode([]); + const tupleTypeNode = setEmitFlags(createTupleTypeNode([]), EmitFlags.SingleLine); return (type.target).readonly ? createTypeOperatorNode(SyntaxKind.ReadonlyKeyword, tupleTypeNode) : tupleTypeNode; } context.encounteredError = true; @@ -5543,6 +5548,7 @@ namespace ts { cancellationToken.throwIfCancellationRequested(); } let hadError = false; + const file = getSourceFileOfNode(existing); const transformed = visitNode(existing, visitExistingNodeTreeSymbols); if (hadError) { return undefined; @@ -5566,6 +5572,9 @@ namespace ts { if (isJSDocNonNullableType(node)) { return visitNode(node.type, visitExistingNodeTreeSymbols); } + if (isJSDocVariadicType(node)) { + return createArrayTypeNode(visitNode((node as JSDocVariadicType).type, visitExistingNodeTreeSymbols)); + } if (isTypeReferenceNode(node) && isIdentifier(node.typeName) && node.typeName.escapedText === "") { return setOriginalNode(createKeywordTypeNode(SyntaxKind.AnyKeyword), node); } @@ -5592,8 +5601,8 @@ namespace ts { mapDefined(node.parameters, (p, i) => p.name && isIdentifier(p.name) && p.name.escapedText === "new" ? (newTypeNode = p.type, undefined) : createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, - p.dotDotDotToken, - p.name || p.dotDotDotToken ? `args` : `arg${i}`, + getEffectiveDotDotDotForParameter(p), + p.name || getEffectiveDotDotDotForParameter(p) ? `args` : `arg${i}`, p.questionToken, visitNode(p.type, visitExistingNodeTreeSymbols), /*initializer*/ undefined @@ -5607,8 +5616,8 @@ namespace ts { map(node.parameters, (p, i) => createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, - p.dotDotDotToken, - p.name || p.dotDotDotToken ? `args` : `arg${i}`, + getEffectiveDotDotDotForParameter(p), + p.name || getEffectiveDotDotDotForParameter(p) ? `args` : `arg${i}`, p.questionToken, visitNode(p.type, visitExistingNodeTreeSymbols), /*initializer*/ undefined @@ -5650,8 +5659,16 @@ namespace ts { } } + if (file && isTupleTypeNode(node) && (getLineAndCharacterOfPosition(file, node.pos).line === getLineAndCharacterOfPosition(file, node.end).line)) { + setEmitFlags(node, EmitFlags.SingleLine); + } + return visitEachChild(node, visitExistingNodeTreeSymbols, nullTransformationContext); + function getEffectiveDotDotDotForParameter(p: ParameterDeclaration) { + return p.dotDotDotToken || (p.type && isJSDocVariadicType(p.type) ? createToken(SyntaxKind.DotDotDotToken) : undefined); + } + function rewriteModuleSpecifier(parent: ImportTypeNode, lit: StringLiteral) { if (bundled) { if (context.tracker && context.tracker.moduleResolverHost) { @@ -6892,7 +6909,7 @@ namespace ts { function getTypeAliasForTypeLiteral(type: Type): Symbol | undefined { if (type.symbol && type.symbol.flags & SymbolFlags.TypeLiteral) { - const node = findAncestor(type.symbol.declarations[0].parent, n => n.kind !== SyntaxKind.ParenthesizedType)!; + const node = walkUpParenthesizedTypes(type.symbol.declarations[0].parent); if (node.kind === SyntaxKind.TypeAliasDeclaration) { return getSymbolOfNode(node); } @@ -7080,6 +7097,7 @@ namespace ts { case SyntaxKind.UnionType: case SyntaxKind.IntersectionType: case SyntaxKind.ParenthesizedType: + case SyntaxKind.NamedTupleMember: return isDeclarationVisible(node.parent); // Default binding, import specifier and namespace import is visible @@ -11471,7 +11489,7 @@ namespace ts { const typeArguments = !node ? emptyArray : node.kind === SyntaxKind.TypeReference ? concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters!)) : node.kind === SyntaxKind.ArrayType ? [getTypeFromTypeNode(node.elementType)] : - map(node.elementTypes, getTypeFromTypeNode); + map(node.elements, getTypeFromTypeNode); if (popTypeResolution()) { type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments; } @@ -11677,11 +11695,11 @@ namespace ts { } function isUnaryTupleTypeNode(node: TypeNode) { - return node.kind === SyntaxKind.TupleType && (node).elementTypes.length === 1; + return node.kind === SyntaxKind.TupleType && (node).elements.length === 1; } function getImpliedConstraint(type: Type, checkNode: TypeNode, extendsNode: TypeNode): Type | undefined { - return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, (checkNode).elementTypes[0], (extendsNode).elementTypes[0]) : + return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, (checkNode).elements[0], (extendsNode).elements[0]) : getActualTypeVariable(getTypeFromTypeNode(checkNode)) === type ? getTypeFromTypeNode(extendsNode) : undefined; } @@ -11977,15 +11995,27 @@ namespace ts { return createTypeFromGenericGlobalType(readonly ? globalReadonlyArrayType : globalArrayType, [elementType]); } + function unwrapNamedTupleMember(node: TypeNode): TypeNode { + return node.kind === SyntaxKind.NamedTupleMember ? (node as NamedTupleMember).type : node; + } + function getArrayOrTupleTargetType(node: ArrayTypeNode | TupleTypeNode): GenericType { const readonly = isReadonlyTypeOperator(node.parent); - if (node.kind === SyntaxKind.ArrayType || node.elementTypes.length === 1 && node.elementTypes[0].kind === SyntaxKind.RestType) { + if (node.kind === SyntaxKind.ArrayType || node.elements.length === 1 && node.elements[0].kind === SyntaxKind.RestType) { return readonly ? globalReadonlyArrayType : globalArrayType; } - const lastElement = lastOrUndefined(node.elementTypes); - const restElement = lastElement && lastElement.kind === SyntaxKind.RestType ? lastElement : undefined; - const minLength = findLastIndex(node.elementTypes, n => n.kind !== SyntaxKind.OptionalType && n !== restElement) + 1; - return getTupleTypeOfArity(node.elementTypes.length, minLength, !!restElement, readonly, /*associatedNames*/ undefined); + const lastElement = lastOrUndefined(node.elements); + const restElement = lastElement && unwrapNamedTupleMember(lastElement).kind === SyntaxKind.RestType ? lastElement : undefined; + const minLength = findLastIndex(node.elements, n => unwrapNamedTupleMember(n).kind !== SyntaxKind.OptionalType && n !== restElement) + 1; + let missingName = false; + const names = map(node.elements, e => { + if (e.kind !== SyntaxKind.NamedTupleMember) { + missingName = true; + return escapeLeadingUnderscores("arg"); + } + return (e as NamedTupleMember).name.escapedText; + }); + return getTupleTypeOfArity(node.elements.length, minLength, !!restElement, readonly, /*associatedNames*/ missingName ? undefined : names); } // Return true if the given type reference node is directly aliased or if it needs to be deferred @@ -11993,7 +12023,7 @@ namespace ts { function isDeferredTypeReferenceNode(node: TypeReferenceNode | ArrayTypeNode | TupleTypeNode, hasDefaultTypeArguments?: boolean) { return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && ( node.kind === SyntaxKind.ArrayType ? mayResolveTypeAlias(node.elementType) : - node.kind === SyntaxKind.TupleType ? some(node.elementTypes, mayResolveTypeAlias) : + node.kind === SyntaxKind.TupleType ? some(node.elements, mayResolveTypeAlias) : hasDefaultTypeArguments || some(node.typeArguments, mayResolveTypeAlias)); } @@ -12004,6 +12034,7 @@ namespace ts { const parent = node.parent; switch (parent.kind) { case SyntaxKind.ParenthesizedType: + case SyntaxKind.NamedTupleMember: case SyntaxKind.TypeReference: case SyntaxKind.UnionType: case SyntaxKind.IntersectionType: @@ -12031,11 +12062,12 @@ namespace ts { return (node).operator !== SyntaxKind.UniqueKeyword && mayResolveTypeAlias((node).type); case SyntaxKind.ParenthesizedType: case SyntaxKind.OptionalType: + case SyntaxKind.NamedTupleMember: case SyntaxKind.JSDocOptionalType: case SyntaxKind.JSDocNullableType: case SyntaxKind.JSDocNonNullableType: case SyntaxKind.JSDocTypeExpression: - return mayResolveTypeAlias((node).type); + return mayResolveTypeAlias((node).type); case SyntaxKind.RestType: return (node).type.kind !== SyntaxKind.ArrayType || mayResolveTypeAlias(((node).type).elementType); case SyntaxKind.UnionType: @@ -12058,11 +12090,11 @@ namespace ts { links.resolvedType = emptyObjectType; } else if (isDeferredTypeReferenceNode(node)) { - links.resolvedType = node.kind === SyntaxKind.TupleType && node.elementTypes.length === 0 ? target : + links.resolvedType = node.kind === SyntaxKind.TupleType && node.elements.length === 0 ? target : createDeferredTypeReference(target, node, /*mapper*/ undefined); } else { - const elementTypes = node.kind === SyntaxKind.ArrayType ? [getTypeFromTypeNode(node.elementType)] : map(node.elementTypes, getTypeFromTypeNode); + const elementTypes = node.kind === SyntaxKind.ArrayType ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode); links.resolvedType = createTypeReference(target, elementTypes); } } @@ -13416,7 +13448,7 @@ namespace ts { function getAliasSymbolForTypeNode(node: Node) { let host = node.parent; - while (isParenthesizedTypeNode(host) || isTypeOperatorNode(host) && host.operator === SyntaxKind.ReadonlyKeyword) { + while (isParenthesizedTypeNode(host) || host.kind === SyntaxKind.NamedTupleMember || isTypeOperatorNode(host) && host.operator === SyntaxKind.ReadonlyKeyword) { host = host.parent; } return isTypeAlias(host) ? getSymbolOfNode(host) : undefined; @@ -13788,9 +13820,10 @@ namespace ts { case SyntaxKind.JSDocOptionalType: return addOptionality(getTypeFromTypeNode((node as JSDocOptionalType).type)); case SyntaxKind.ParenthesizedType: + case SyntaxKind.NamedTupleMember: case SyntaxKind.JSDocNonNullableType: case SyntaxKind.JSDocTypeExpression: - return getTypeFromTypeNode((node).type); + return getTypeFromTypeNode((node).type); case SyntaxKind.RestType: return getElementTypeOfArrayType(getTypeFromTypeNode((node).type)) || errorType; case SyntaxKind.JSDocVariadicType: @@ -29966,10 +29999,19 @@ namespace ts { } function checkTupleType(node: TupleTypeNode) { - const elementTypes = node.elementTypes; + const elementTypes = node.elements; let seenOptionalElement = false; + let seenNamedElement = false; for (let i = 0; i < elementTypes.length; i++) { - const e = elementTypes[i]; + let e = elementTypes[i]; + if (e.kind === SyntaxKind.NamedTupleMember) { + seenNamedElement = true; + e = (e as NamedTupleMember).type; + } + else if (seenNamedElement) { + grammarErrorOnNode(e, Diagnostics.Tuple_members_must_all_have_names_or_not_have_names); + break; + } if (e.kind === SyntaxKind.RestType) { if (i !== elementTypes.length - 1) { grammarErrorOnNode(e, Diagnostics.A_rest_element_must_be_last_in_a_tuple_type); @@ -29987,7 +30029,7 @@ namespace ts { break; } } - forEach(node.elementTypes, checkSourceElement); + forEach(node.elements, checkSourceElement); } function checkUnionOrIntersectionType(node: UnionOrIntersectionTypeNode) { @@ -30073,6 +30115,17 @@ namespace ts { getTypeFromTypeNode(node); } + function checkNamedTupleMember(node: NamedTupleMember) { + if (node.dotDotDotToken) { + grammarErrorOnNode(node, Diagnostics.Rest_tuple_members_are_declared_with_a_on_the_type_A_on_the_name_is_invalid); + } + if (node.questionToken) { + grammarErrorOnNode(node, Diagnostics.Tuple_members_express_optionality_with_a_trailing_question_mark_on_the_type_a_question_mark_on_the_member_name_is_invalid); + } + checkSourceElement(node.type); + getTypeFromTypeNode(node); + } + function isPrivateWithinAmbient(node: Node): boolean { return (hasModifier(node, ModifierFlags.Private) || isPrivateIdentifierPropertyDeclaration(node)) && !!(node.flags & NodeFlags.Ambient); } @@ -30852,6 +30905,7 @@ namespace ts { return getEntityNameForDecoratorMetadataFromTypeList([(node).trueType, (node).falseType]); case SyntaxKind.ParenthesizedType: + case SyntaxKind.NamedTupleMember: return getEntityNameForDecoratorMetadata((node).type); case SyntaxKind.TypeReference: @@ -30863,8 +30917,8 @@ namespace ts { function getEntityNameForDecoratorMetadataFromTypeList(types: readonly TypeNode[]): EntityName | undefined { let commonEntityName: EntityName | undefined; for (let typeNode of types) { - while (typeNode.kind === SyntaxKind.ParenthesizedType) { - typeNode = (typeNode as ParenthesizedTypeNode).type; // Skip parens if need be + while (typeNode.kind === SyntaxKind.ParenthesizedType || typeNode.kind === SyntaxKind.NamedTupleMember) { + typeNode = (typeNode as ParenthesizedTypeNode | NamedTupleMember).type; // Skip parens if need be } if (typeNode.kind === SyntaxKind.NeverKeyword) { continue; // Always elide `never` from the union/intersection if possible @@ -34617,6 +34671,8 @@ namespace ts { return checkInferType(node); case SyntaxKind.ImportType: return checkImportType(node); + case SyntaxKind.NamedTupleMember: + return checkNamedTupleMember(node); case SyntaxKind.JSDocAugmentsTag: return checkJSDocAugmentsTag(node as JSDocAugmentsTag); case SyntaxKind.JSDocImplementsTag: diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 03f426084545b..d09b92b70ccbe 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3513,6 +3513,18 @@ "category": "Error", "code": 5083 }, + "Tuple members must all have names or not have names.": { + "category": "Error", + "code": 5084 + }, + "Tuple members express optionality with a trailing question mark on the type, a question mark on the member name is invalid.": { + "category": "Error", + "code": 5085 + }, + "Rest tuple members are declared with a `...` on the type. A `...` on the name is invalid.": { + "category": "Error", + "code": 5086 + }, "Generates a sourcemap for each corresponding '.d.ts' file.": { "category": "Message", diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index dc4b9ad5f2f5e..175c134678998 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -1370,6 +1370,8 @@ namespace ts { case SyntaxKind.RestType: case SyntaxKind.JSDocVariadicType: return emitRestOrJSDocVariadicType(node as RestTypeNode | JSDocVariadicType); + case SyntaxKind.NamedTupleMember: + return emitNamedTupleMember(node as NamedTupleMember); // Binding patterns case SyntaxKind.ObjectBindingPattern: @@ -2099,9 +2101,17 @@ namespace ts { } function emitTupleType(node: TupleTypeNode) { - writePunctuation("["); - emitList(node, node.elementTypes, ListFormat.TupleTypeElements); - writePunctuation("]"); + emitTokenWithComment(SyntaxKind.OpenBracketToken, node.pos, writePunctuation, node); + const flags = getEmitFlags(node) & EmitFlags.SingleLine ? ListFormat.SingleLineTupleTypeElements : ListFormat.MultiLineTupleTypeElements; + emitList(node, node.elements, flags | ListFormat.NoSpaceIfEmpty); + emitTokenWithComment(SyntaxKind.CloseBracketToken, node.elements.end, writePunctuation, node); + } + + function emitNamedTupleMember(node: NamedTupleMember) { + emit(node.name); + emitTokenWithComment(SyntaxKind.ColonToken, node.name.end, writePunctuation, node); + writeSpace(); + emit(node.type); } function emitOptionalType(node: OptionalTypeNode) { diff --git a/src/compiler/factoryPublic.ts b/src/compiler/factoryPublic.ts index e17cf3c505459..f095460a13341 100644 --- a/src/compiler/factoryPublic.ts +++ b/src/compiler/factoryPublic.ts @@ -810,15 +810,15 @@ namespace ts { : node; } - export function createTupleTypeNode(elementTypes: readonly TypeNode[]) { + export function createTupleTypeNode(elements: readonly (TypeNode | NamedTupleMember)[]) { const node = createSynthesizedNode(SyntaxKind.TupleType) as TupleTypeNode; - node.elementTypes = createNodeArray(elementTypes); + node.elements = createNodeArray(elements); return node; } - export function updateTupleTypeNode(node: TupleTypeNode, elementTypes: readonly TypeNode[]) { - return node.elementTypes !== elementTypes - ? updateNode(createTupleTypeNode(elementTypes), node) + export function updateTupleTypeNode(node: TupleTypeNode, elements: readonly (TypeNode | NamedTupleMember)[]) { + return node.elements !== elements + ? updateNode(createTupleTypeNode(elements), node) : node; } @@ -934,6 +934,20 @@ namespace ts { : node; } + export function createNamedTupleMember(name: Identifier, type: TypeNode) { + const node = createSynthesizedNode(SyntaxKind.NamedTupleMember); + node.name = name; + node.type = type; + return node; + } + + export function updateNamedTupleMember(node: NamedTupleMember, name: Identifier, type: TypeNode) { + return node.name !== name + || node.type !== type + ? updateNode(createNamedTupleMember(name, type), node) + : node; + } + export function createThisTypeNode() { return createSynthesizedNode(SyntaxKind.ThisType); } @@ -2524,6 +2538,21 @@ namespace ts { return node; } + + /* @internal */ + export function createJSDocVariadicType(type: TypeNode): JSDocVariadicType { + const node = createSynthesizedNode(SyntaxKind.JSDocVariadicType) as JSDocVariadicType; + node.type = type; + return node; + } + + /* @internal */ + export function updateJSDocVariadicType(node: JSDocVariadicType, type: TypeNode): JSDocVariadicType { + return node.type !== type + ? updateNode(createJSDocVariadicType(type), node) + : node; + } + // JSX export function createJsxElement(openingElement: JsxOpeningElement, children: readonly JsxChild[], closingElement: JsxClosingElement) { diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index ae13b11389779..50894a8815e18 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -179,7 +179,7 @@ namespace ts { case SyntaxKind.ArrayType: return visitNode(cbNode, (node).elementType); case SyntaxKind.TupleType: - return visitNodes(cbNode, cbNodes, (node).elementTypes); + return visitNodes(cbNode, cbNodes, (node).elements); case SyntaxKind.UnionType: case SyntaxKind.IntersectionType: return visitNodes(cbNode, cbNodes, (node).types); @@ -207,6 +207,11 @@ namespace ts { visitNode(cbNode, (node).type); case SyntaxKind.LiteralType: return visitNode(cbNode, (node).literal); + case SyntaxKind.NamedTupleMember: + return visitNode(cbNode, (node).dotDotDotToken) || + visitNode(cbNode, (node).name) || + visitNode(cbNode, (node).questionToken) || + visitNode(cbNode, (node).type); case SyntaxKind.ObjectBindingPattern: case SyntaxKind.ArrayBindingPattern: return visitNodes(cbNode, cbNodes, (node).elements); @@ -3056,9 +3061,33 @@ namespace ts { return type; } + function isNextTokenColonOrQuestionColon() { + return nextToken() === SyntaxKind.ColonToken || (token() === SyntaxKind.QuestionToken && nextToken() === SyntaxKind.ColonToken); + } + + function isTupleElementName() { + if (token() === SyntaxKind.DotDotDotToken) { + return tokenIsIdentifierOrKeyword(nextToken()) && isNextTokenColonOrQuestionColon(); + } + return tokenIsIdentifierOrKeyword(token()) && isNextTokenColonOrQuestionColon(); + } + + function parseTupleElementNameOrTupleElementType() { + if (lookAhead(isTupleElementName)) { + const node = createNode(SyntaxKind.NamedTupleMember); + node.dotDotDotToken = parseOptionalToken(SyntaxKind.DotDotDotToken); + node.name = parseIdentifierName(); + node.questionToken = parseOptionalToken(SyntaxKind.QuestionToken); + parseExpected(SyntaxKind.ColonToken); + node.type = parseTupleElementType(); + return addJSDocComment(finishNode(node)); + } + return parseTupleElementType(); + } + function parseTupleType(): TupleTypeNode { const node = createNode(SyntaxKind.TupleType); - node.elementTypes = parseBracketedList(ParsingContext.TupleElementTypes, parseTupleElementType, SyntaxKind.OpenBracketToken, SyntaxKind.CloseBracketToken); + node.elements = parseBracketedList(ParsingContext.TupleElementTypes, parseTupleElementNameOrTupleElementType, SyntaxKind.OpenBracketToken, SyntaxKind.CloseBracketToken); return finishNode(node); } diff --git a/src/compiler/transformers/declarations.ts b/src/compiler/transformers/declarations.ts index 413ff8f8cd2e5..d39b43b0f5620 100644 --- a/src/compiler/transformers/declarations.ts +++ b/src/compiler/transformers/declarations.ts @@ -1018,6 +1018,10 @@ namespace ts { } } + if (isTupleTypeNode(input) && (getLineAndCharacterOfPosition(currentSourceFile, input.pos).line === getLineAndCharacterOfPosition(currentSourceFile, input.end).line)) { + setEmitFlags(input, EmitFlags.SingleLine); + } + return cleanup(visitEachChild(input, visitDeclarationSubtree, context)); function cleanup(returnValue: T | undefined): T | undefined { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 8cf06d4ab4e6c..23039ae594407 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -328,6 +328,7 @@ namespace ts { IndexedAccessType, MappedType, LiteralType, + NamedTupleMember, ImportType, // Binding patterns ObjectBindingPattern, @@ -699,6 +700,7 @@ namespace ts { | ConstructorTypeNode | JSDocFunctionType | ExportDeclaration + | NamedTupleMember | EndOfFileToken; export type HasType = @@ -1273,7 +1275,15 @@ namespace ts { export interface TupleTypeNode extends TypeNode { kind: SyntaxKind.TupleType; - elementTypes: NodeArray; + elements: NodeArray; + } + + export interface NamedTupleMember extends TypeNode, JSDocContainer { + kind: SyntaxKind.NamedTupleMember; + dotDotDotToken?: Token; + name: Identifier; + questionToken?: Token; + type: TypeNode; } export interface OptionalTypeNode extends TypeNode { @@ -6570,7 +6580,8 @@ namespace ts { SingleLineTypeLiteralMembers = SingleLine | SpaceBetweenBraces | SpaceBetweenSiblings, MultiLineTypeLiteralMembers = MultiLine | Indented | OptionalIfEmpty, - TupleTypeElements = CommaDelimited | SpaceBetweenSiblings | SingleLine, + SingleLineTupleTypeElements = CommaDelimited | SpaceBetweenSiblings | SingleLine, + MultiLineTupleTypeElements = CommaDelimited | Indented | SpaceBetweenSiblings | MultiLine, UnionTypeConstituents = BarDelimited | SpaceBetweenSiblings | SingleLine, IntersectionTypeConstituents = AmpersandDelimited | SpaceBetweenSiblings | SingleLine, ObjectBindingPatternElements = SingleLine | AllowTrailingComma | SpaceBetweenBraces | CommaDelimited | SpaceBetweenSiblings | NoSpaceIfEmpty, diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 97231acf60b88..f105dfc6e14ce 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -2702,7 +2702,10 @@ namespace ts { } export function walkUpParenthesizedTypes(node: Node) { - return walkUp(node, SyntaxKind.ParenthesizedType); + while (node && (node.kind === SyntaxKind.ParenthesizedType || node.kind === SyntaxKind.NamedTupleMember)) { + node = node.parent; + } + return node; } export function walkUpParenthesizedExpressions(node: Node) { diff --git a/src/compiler/visitorPublic.ts b/src/compiler/visitorPublic.ts index b21af6186db2f..dbb1dc1a0575c 100644 --- a/src/compiler/visitorPublic.ts +++ b/src/compiler/visitorPublic.ts @@ -480,7 +480,7 @@ namespace ts { case SyntaxKind.TupleType: return updateTupleTypeNode((node), - nodesVisitor((node).elementTypes, visitor, isTypeNode)); + nodesVisitor((node).elements, visitor, isTypeNode)); case SyntaxKind.OptionalType: return updateOptionalTypeNode((node), @@ -517,6 +517,12 @@ namespace ts { (node).isTypeOf ); + case SyntaxKind.NamedTupleMember: + return updateNamedTupleMember(node, + visitNode((node).name, visitor, isIdentifierName), + visitNode((node).type, visitor, isTypeNode), + ); + case SyntaxKind.ParenthesizedType: return updateParenthesizedType(node, visitNode((node).type, visitor, isTypeNode)); diff --git a/src/services/refactors/extractType.ts b/src/services/refactors/extractType.ts index 813ee186f0faa..560fc5deb684a 100644 --- a/src/services/refactors/extractType.ts +++ b/src/services/refactors/extractType.ts @@ -145,6 +145,11 @@ namespace ts.refactor { } } } + + if (file && isTupleTypeNode(node) && (getLineAndCharacterOfPosition(file, node.pos).line === getLineAndCharacterOfPosition(file, node.end).line)) { + setEmitFlags(node, EmitFlags.SingleLine); + } + return forEachChild(node, visitor); } } diff --git a/src/testRunner/unittests/printer.ts b/src/testRunner/unittests/printer.ts index d04bf65603c11..e96aba3674948 100644 --- a/src/testRunner/unittests/printer.ts +++ b/src/testRunner/unittests/printer.ts @@ -229,7 +229,7 @@ namespace ts { // https://github.com/Microsoft/TypeScript/issues/15651 printsCorrectly("functionTypes", {}, printer => printer.printNode( EmitHint.Unspecified, - createTupleTypeNode([ + setEmitFlags(createTupleTypeNode([ createFunctionTypeNode( /*typeArguments*/ undefined, [createParameter( @@ -293,7 +293,7 @@ namespace ts { )], createKeywordTypeNode(SyntaxKind.AnyKeyword) ), - ]), + ]), EmitFlags.SingleLine), createSourceFile("source.ts", "", ScriptTarget.ES2015) )); }); diff --git a/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.tupleType0.json b/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.tupleType0.json index 61631cabce44b..8bce108137668 100644 --- a/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.tupleType0.json +++ b/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.tupleType0.json @@ -5,7 +5,7 @@ "flags": "JSDoc", "modifierFlagsCache": 0, "transformFlags": 0, - "elementTypes": { + "elements": { "length": 0, "pos": 2, "end": 2 diff --git a/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.tupleType1.json b/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.tupleType1.json index c8373fe5e875a..dc98f9164e73a 100644 --- a/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.tupleType1.json +++ b/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.tupleType1.json @@ -5,7 +5,7 @@ "flags": "JSDoc", "modifierFlagsCache": 0, "transformFlags": 0, - "elementTypes": { + "elements": { "0": { "kind": "NumberKeyword", "pos": 2, diff --git a/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.tupleType2.json b/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.tupleType2.json index 78875855840e8..f6da41187797f 100644 --- a/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.tupleType2.json +++ b/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.tupleType2.json @@ -5,7 +5,7 @@ "flags": "JSDoc", "modifierFlagsCache": 0, "transformFlags": 0, - "elementTypes": { + "elements": { "0": { "kind": "NumberKeyword", "pos": 2, diff --git a/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.tupleType3.json b/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.tupleType3.json index c1b537d2945af..08c3a7dbede68 100644 --- a/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.tupleType3.json +++ b/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.tupleType3.json @@ -5,7 +5,7 @@ "flags": "JSDoc", "modifierFlagsCache": 0, "transformFlags": 0, - "elementTypes": { + "elements": { "0": { "kind": "NumberKeyword", "pos": 2, diff --git a/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.tupleTypeWithTrailingComma.json b/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.tupleTypeWithTrailingComma.json index b859519b8da34..da5978138999b 100644 --- a/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.tupleTypeWithTrailingComma.json +++ b/tests/baselines/reference/JSDocParsing/TypeExpressions.parsesCorrectly.tupleTypeWithTrailingComma.json @@ -5,7 +5,7 @@ "flags": "JSDoc", "modifierFlagsCache": 0, "transformFlags": 0, - "elementTypes": { + "elements": { "0": { "kind": "NumberKeyword", "pos": 2, diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 27bd23efaa3da..87185c1fea886 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -263,150 +263,151 @@ declare namespace ts { IndexedAccessType = 185, MappedType = 186, LiteralType = 187, - ImportType = 188, - ObjectBindingPattern = 189, - ArrayBindingPattern = 190, - BindingElement = 191, - ArrayLiteralExpression = 192, - ObjectLiteralExpression = 193, - PropertyAccessExpression = 194, - ElementAccessExpression = 195, - CallExpression = 196, - NewExpression = 197, - TaggedTemplateExpression = 198, - TypeAssertionExpression = 199, - ParenthesizedExpression = 200, - FunctionExpression = 201, - ArrowFunction = 202, - DeleteExpression = 203, - TypeOfExpression = 204, - VoidExpression = 205, - AwaitExpression = 206, - PrefixUnaryExpression = 207, - PostfixUnaryExpression = 208, - BinaryExpression = 209, - ConditionalExpression = 210, - TemplateExpression = 211, - YieldExpression = 212, - SpreadElement = 213, - ClassExpression = 214, - OmittedExpression = 215, - ExpressionWithTypeArguments = 216, - AsExpression = 217, - NonNullExpression = 218, - MetaProperty = 219, - SyntheticExpression = 220, - TemplateSpan = 221, - SemicolonClassElement = 222, - Block = 223, - EmptyStatement = 224, - VariableStatement = 225, - ExpressionStatement = 226, - IfStatement = 227, - DoStatement = 228, - WhileStatement = 229, - ForStatement = 230, - ForInStatement = 231, - ForOfStatement = 232, - ContinueStatement = 233, - BreakStatement = 234, - ReturnStatement = 235, - WithStatement = 236, - SwitchStatement = 237, - LabeledStatement = 238, - ThrowStatement = 239, - TryStatement = 240, - DebuggerStatement = 241, - VariableDeclaration = 242, - VariableDeclarationList = 243, - FunctionDeclaration = 244, - ClassDeclaration = 245, - InterfaceDeclaration = 246, - TypeAliasDeclaration = 247, - EnumDeclaration = 248, - ModuleDeclaration = 249, - ModuleBlock = 250, - CaseBlock = 251, - NamespaceExportDeclaration = 252, - ImportEqualsDeclaration = 253, - ImportDeclaration = 254, - ImportClause = 255, - NamespaceImport = 256, - NamedImports = 257, - ImportSpecifier = 258, - ExportAssignment = 259, - ExportDeclaration = 260, - NamedExports = 261, - NamespaceExport = 262, - ExportSpecifier = 263, - MissingDeclaration = 264, - ExternalModuleReference = 265, - JsxElement = 266, - JsxSelfClosingElement = 267, - JsxOpeningElement = 268, - JsxClosingElement = 269, - JsxFragment = 270, - JsxOpeningFragment = 271, - JsxClosingFragment = 272, - JsxAttribute = 273, - JsxAttributes = 274, - JsxSpreadAttribute = 275, - JsxExpression = 276, - CaseClause = 277, - DefaultClause = 278, - HeritageClause = 279, - CatchClause = 280, - PropertyAssignment = 281, - ShorthandPropertyAssignment = 282, - SpreadAssignment = 283, - EnumMember = 284, - UnparsedPrologue = 285, - UnparsedPrepend = 286, - UnparsedText = 287, - UnparsedInternalText = 288, - UnparsedSyntheticReference = 289, - SourceFile = 290, - Bundle = 291, - UnparsedSource = 292, - InputFiles = 293, - JSDocTypeExpression = 294, - JSDocAllType = 295, - JSDocUnknownType = 296, - JSDocNullableType = 297, - JSDocNonNullableType = 298, - JSDocOptionalType = 299, - JSDocFunctionType = 300, - JSDocVariadicType = 301, - JSDocNamepathType = 302, - JSDocComment = 303, - JSDocTypeLiteral = 304, - JSDocSignature = 305, - JSDocTag = 306, - JSDocAugmentsTag = 307, - JSDocImplementsTag = 308, - JSDocAuthorTag = 309, - JSDocClassTag = 310, - JSDocPublicTag = 311, - JSDocPrivateTag = 312, - JSDocProtectedTag = 313, - JSDocReadonlyTag = 314, - JSDocCallbackTag = 315, - JSDocEnumTag = 316, - JSDocParameterTag = 317, - JSDocReturnTag = 318, - JSDocThisTag = 319, - JSDocTypeTag = 320, - JSDocTemplateTag = 321, - JSDocTypedefTag = 322, - JSDocPropertyTag = 323, - SyntaxList = 324, - NotEmittedStatement = 325, - PartiallyEmittedExpression = 326, - CommaListExpression = 327, - MergeDeclarationMarker = 328, - EndOfDeclarationMarker = 329, - SyntheticReferenceExpression = 330, - Count = 331, + NamedTupleMember = 188, + ImportType = 189, + ObjectBindingPattern = 190, + ArrayBindingPattern = 191, + BindingElement = 192, + ArrayLiteralExpression = 193, + ObjectLiteralExpression = 194, + PropertyAccessExpression = 195, + ElementAccessExpression = 196, + CallExpression = 197, + NewExpression = 198, + TaggedTemplateExpression = 199, + TypeAssertionExpression = 200, + ParenthesizedExpression = 201, + FunctionExpression = 202, + ArrowFunction = 203, + DeleteExpression = 204, + TypeOfExpression = 205, + VoidExpression = 206, + AwaitExpression = 207, + PrefixUnaryExpression = 208, + PostfixUnaryExpression = 209, + BinaryExpression = 210, + ConditionalExpression = 211, + TemplateExpression = 212, + YieldExpression = 213, + SpreadElement = 214, + ClassExpression = 215, + OmittedExpression = 216, + ExpressionWithTypeArguments = 217, + AsExpression = 218, + NonNullExpression = 219, + MetaProperty = 220, + SyntheticExpression = 221, + TemplateSpan = 222, + SemicolonClassElement = 223, + Block = 224, + EmptyStatement = 225, + VariableStatement = 226, + ExpressionStatement = 227, + IfStatement = 228, + DoStatement = 229, + WhileStatement = 230, + ForStatement = 231, + ForInStatement = 232, + ForOfStatement = 233, + ContinueStatement = 234, + BreakStatement = 235, + ReturnStatement = 236, + WithStatement = 237, + SwitchStatement = 238, + LabeledStatement = 239, + ThrowStatement = 240, + TryStatement = 241, + DebuggerStatement = 242, + VariableDeclaration = 243, + VariableDeclarationList = 244, + FunctionDeclaration = 245, + ClassDeclaration = 246, + InterfaceDeclaration = 247, + TypeAliasDeclaration = 248, + EnumDeclaration = 249, + ModuleDeclaration = 250, + ModuleBlock = 251, + CaseBlock = 252, + NamespaceExportDeclaration = 253, + ImportEqualsDeclaration = 254, + ImportDeclaration = 255, + ImportClause = 256, + NamespaceImport = 257, + NamedImports = 258, + ImportSpecifier = 259, + ExportAssignment = 260, + ExportDeclaration = 261, + NamedExports = 262, + NamespaceExport = 263, + ExportSpecifier = 264, + MissingDeclaration = 265, + ExternalModuleReference = 266, + JsxElement = 267, + JsxSelfClosingElement = 268, + JsxOpeningElement = 269, + JsxClosingElement = 270, + JsxFragment = 271, + JsxOpeningFragment = 272, + JsxClosingFragment = 273, + JsxAttribute = 274, + JsxAttributes = 275, + JsxSpreadAttribute = 276, + JsxExpression = 277, + CaseClause = 278, + DefaultClause = 279, + HeritageClause = 280, + CatchClause = 281, + PropertyAssignment = 282, + ShorthandPropertyAssignment = 283, + SpreadAssignment = 284, + EnumMember = 285, + UnparsedPrologue = 286, + UnparsedPrepend = 287, + UnparsedText = 288, + UnparsedInternalText = 289, + UnparsedSyntheticReference = 290, + SourceFile = 291, + Bundle = 292, + UnparsedSource = 293, + InputFiles = 294, + JSDocTypeExpression = 295, + JSDocAllType = 296, + JSDocUnknownType = 297, + JSDocNullableType = 298, + JSDocNonNullableType = 299, + JSDocOptionalType = 300, + JSDocFunctionType = 301, + JSDocVariadicType = 302, + JSDocNamepathType = 303, + JSDocComment = 304, + JSDocTypeLiteral = 305, + JSDocSignature = 306, + JSDocTag = 307, + JSDocAugmentsTag = 308, + JSDocImplementsTag = 309, + JSDocAuthorTag = 310, + JSDocClassTag = 311, + JSDocPublicTag = 312, + JSDocPrivateTag = 313, + JSDocProtectedTag = 314, + JSDocReadonlyTag = 315, + JSDocCallbackTag = 316, + JSDocEnumTag = 317, + JSDocParameterTag = 318, + JSDocReturnTag = 319, + JSDocThisTag = 320, + JSDocTypeTag = 321, + JSDocTemplateTag = 322, + JSDocTypedefTag = 323, + JSDocPropertyTag = 324, + SyntaxList = 325, + NotEmittedStatement = 326, + PartiallyEmittedExpression = 327, + CommaListExpression = 328, + MergeDeclarationMarker = 329, + EndOfDeclarationMarker = 330, + SyntheticReferenceExpression = 331, + Count = 332, FirstAssignment = 62, LastAssignment = 74, FirstCompoundAssignment = 63, @@ -418,7 +419,7 @@ declare namespace ts { FirstFutureReservedWord = 113, LastFutureReservedWord = 121, FirstTypeNode = 168, - LastTypeNode = 188, + LastTypeNode = 189, FirstPunctuation = 18, LastPunctuation = 74, FirstToken = 0, @@ -431,13 +432,13 @@ declare namespace ts { LastTemplateToken = 17, FirstBinaryOperator = 29, LastBinaryOperator = 74, - FirstStatement = 225, - LastStatement = 241, + FirstStatement = 226, + LastStatement = 242, FirstNode = 153, - FirstJSDocNode = 294, - LastJSDocNode = 323, - FirstJSDocTagNode = 306, - LastJSDocTagNode = 323, + FirstJSDocNode = 295, + LastJSDocNode = 324, + FirstJSDocTagNode = 307, + LastJSDocTagNode = 324, } export enum NodeFlags { None = 0, @@ -507,7 +508,7 @@ declare namespace ts { } export interface JSDocContainer { } - export type HasJSDoc = ParameterDeclaration | CallSignatureDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | LabeledStatement | ExpressionStatement | VariableStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | PropertyDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | ExportDeclaration | EndOfFileToken; + export type HasJSDoc = ParameterDeclaration | CallSignatureDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | LabeledStatement | ExpressionStatement | VariableStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | PropertyDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | ExportDeclaration | NamedTupleMember | EndOfFileToken; export type HasType = SignatureDeclaration | VariableDeclaration | ParameterDeclaration | PropertySignature | PropertyDeclaration | TypePredicateNode | ParenthesizedTypeNode | TypeOperatorNode | MappedTypeNode | AssertionExpression | TypeAliasDeclaration | JSDocTypeExpression | JSDocNonNullableType | JSDocNullableType | JSDocOptionalType | JSDocVariadicType; export type HasTypeArguments = CallExpression | NewExpression | TaggedTemplateExpression | JsxOpeningElement | JsxSelfClosingElement; export type HasInitializer = HasExpressionInitializer | ForStatement | ForInStatement | ForOfStatement | JsxAttribute; @@ -808,7 +809,14 @@ declare namespace ts { } export interface TupleTypeNode extends TypeNode { kind: SyntaxKind.TupleType; - elementTypes: NodeArray; + elements: NodeArray; + } + export interface NamedTupleMember extends TypeNode, JSDocContainer { + kind: SyntaxKind.NamedTupleMember; + dotDotDotToken?: Token; + name: Identifier; + questionToken?: Token; + type: TypeNode; } export interface OptionalTypeNode extends TypeNode { kind: SyntaxKind.OptionalType; @@ -3232,7 +3240,8 @@ declare namespace ts { HeritageClauses = 512, SingleLineTypeLiteralMembers = 768, MultiLineTypeLiteralMembers = 32897, - TupleTypeElements = 528, + SingleLineTupleTypeElements = 528, + MultiLineTupleTypeElements = 657, UnionTypeConstituents = 516, IntersectionTypeConstituents = 520, ObjectBindingPatternElements = 525136, @@ -4052,8 +4061,8 @@ declare namespace ts { function updateTypeLiteralNode(node: TypeLiteralNode, members: NodeArray): TypeLiteralNode; function createArrayTypeNode(elementType: TypeNode): ArrayTypeNode; function updateArrayTypeNode(node: ArrayTypeNode, elementType: TypeNode): ArrayTypeNode; - function createTupleTypeNode(elementTypes: readonly TypeNode[]): TupleTypeNode; - function updateTupleTypeNode(node: TupleTypeNode, elementTypes: readonly TypeNode[]): TupleTypeNode; + function createTupleTypeNode(elements: readonly (TypeNode | NamedTupleMember)[]): TupleTypeNode; + function updateTupleTypeNode(node: TupleTypeNode, elements: readonly (TypeNode | NamedTupleMember)[]): TupleTypeNode; function createOptionalTypeNode(type: TypeNode): OptionalTypeNode; function updateOptionalTypeNode(node: OptionalTypeNode, type: TypeNode): OptionalTypeNode; function createRestTypeNode(type: TypeNode): RestTypeNode; @@ -4071,6 +4080,8 @@ declare namespace ts { function updateImportTypeNode(node: ImportTypeNode, argument: TypeNode, qualifier?: EntityName, typeArguments?: readonly TypeNode[], isTypeOf?: boolean): ImportTypeNode; function createParenthesizedType(type: TypeNode): ParenthesizedTypeNode; function updateParenthesizedType(node: ParenthesizedTypeNode, type: TypeNode): ParenthesizedTypeNode; + function createNamedTupleMember(name: Identifier, type: TypeNode): NamedTupleMember; + function updateNamedTupleMember(node: NamedTupleMember, name: Identifier, type: TypeNode): NamedTupleMember; function createThisTypeNode(): ThisTypeNode; function createTypeOperatorNode(type: TypeNode): TypeOperatorNode; function createTypeOperatorNode(operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword, type: TypeNode): TypeOperatorNode; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 068380e2ad59c..6f6cc12b45a62 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -263,150 +263,151 @@ declare namespace ts { IndexedAccessType = 185, MappedType = 186, LiteralType = 187, - ImportType = 188, - ObjectBindingPattern = 189, - ArrayBindingPattern = 190, - BindingElement = 191, - ArrayLiteralExpression = 192, - ObjectLiteralExpression = 193, - PropertyAccessExpression = 194, - ElementAccessExpression = 195, - CallExpression = 196, - NewExpression = 197, - TaggedTemplateExpression = 198, - TypeAssertionExpression = 199, - ParenthesizedExpression = 200, - FunctionExpression = 201, - ArrowFunction = 202, - DeleteExpression = 203, - TypeOfExpression = 204, - VoidExpression = 205, - AwaitExpression = 206, - PrefixUnaryExpression = 207, - PostfixUnaryExpression = 208, - BinaryExpression = 209, - ConditionalExpression = 210, - TemplateExpression = 211, - YieldExpression = 212, - SpreadElement = 213, - ClassExpression = 214, - OmittedExpression = 215, - ExpressionWithTypeArguments = 216, - AsExpression = 217, - NonNullExpression = 218, - MetaProperty = 219, - SyntheticExpression = 220, - TemplateSpan = 221, - SemicolonClassElement = 222, - Block = 223, - EmptyStatement = 224, - VariableStatement = 225, - ExpressionStatement = 226, - IfStatement = 227, - DoStatement = 228, - WhileStatement = 229, - ForStatement = 230, - ForInStatement = 231, - ForOfStatement = 232, - ContinueStatement = 233, - BreakStatement = 234, - ReturnStatement = 235, - WithStatement = 236, - SwitchStatement = 237, - LabeledStatement = 238, - ThrowStatement = 239, - TryStatement = 240, - DebuggerStatement = 241, - VariableDeclaration = 242, - VariableDeclarationList = 243, - FunctionDeclaration = 244, - ClassDeclaration = 245, - InterfaceDeclaration = 246, - TypeAliasDeclaration = 247, - EnumDeclaration = 248, - ModuleDeclaration = 249, - ModuleBlock = 250, - CaseBlock = 251, - NamespaceExportDeclaration = 252, - ImportEqualsDeclaration = 253, - ImportDeclaration = 254, - ImportClause = 255, - NamespaceImport = 256, - NamedImports = 257, - ImportSpecifier = 258, - ExportAssignment = 259, - ExportDeclaration = 260, - NamedExports = 261, - NamespaceExport = 262, - ExportSpecifier = 263, - MissingDeclaration = 264, - ExternalModuleReference = 265, - JsxElement = 266, - JsxSelfClosingElement = 267, - JsxOpeningElement = 268, - JsxClosingElement = 269, - JsxFragment = 270, - JsxOpeningFragment = 271, - JsxClosingFragment = 272, - JsxAttribute = 273, - JsxAttributes = 274, - JsxSpreadAttribute = 275, - JsxExpression = 276, - CaseClause = 277, - DefaultClause = 278, - HeritageClause = 279, - CatchClause = 280, - PropertyAssignment = 281, - ShorthandPropertyAssignment = 282, - SpreadAssignment = 283, - EnumMember = 284, - UnparsedPrologue = 285, - UnparsedPrepend = 286, - UnparsedText = 287, - UnparsedInternalText = 288, - UnparsedSyntheticReference = 289, - SourceFile = 290, - Bundle = 291, - UnparsedSource = 292, - InputFiles = 293, - JSDocTypeExpression = 294, - JSDocAllType = 295, - JSDocUnknownType = 296, - JSDocNullableType = 297, - JSDocNonNullableType = 298, - JSDocOptionalType = 299, - JSDocFunctionType = 300, - JSDocVariadicType = 301, - JSDocNamepathType = 302, - JSDocComment = 303, - JSDocTypeLiteral = 304, - JSDocSignature = 305, - JSDocTag = 306, - JSDocAugmentsTag = 307, - JSDocImplementsTag = 308, - JSDocAuthorTag = 309, - JSDocClassTag = 310, - JSDocPublicTag = 311, - JSDocPrivateTag = 312, - JSDocProtectedTag = 313, - JSDocReadonlyTag = 314, - JSDocCallbackTag = 315, - JSDocEnumTag = 316, - JSDocParameterTag = 317, - JSDocReturnTag = 318, - JSDocThisTag = 319, - JSDocTypeTag = 320, - JSDocTemplateTag = 321, - JSDocTypedefTag = 322, - JSDocPropertyTag = 323, - SyntaxList = 324, - NotEmittedStatement = 325, - PartiallyEmittedExpression = 326, - CommaListExpression = 327, - MergeDeclarationMarker = 328, - EndOfDeclarationMarker = 329, - SyntheticReferenceExpression = 330, - Count = 331, + NamedTupleMember = 188, + ImportType = 189, + ObjectBindingPattern = 190, + ArrayBindingPattern = 191, + BindingElement = 192, + ArrayLiteralExpression = 193, + ObjectLiteralExpression = 194, + PropertyAccessExpression = 195, + ElementAccessExpression = 196, + CallExpression = 197, + NewExpression = 198, + TaggedTemplateExpression = 199, + TypeAssertionExpression = 200, + ParenthesizedExpression = 201, + FunctionExpression = 202, + ArrowFunction = 203, + DeleteExpression = 204, + TypeOfExpression = 205, + VoidExpression = 206, + AwaitExpression = 207, + PrefixUnaryExpression = 208, + PostfixUnaryExpression = 209, + BinaryExpression = 210, + ConditionalExpression = 211, + TemplateExpression = 212, + YieldExpression = 213, + SpreadElement = 214, + ClassExpression = 215, + OmittedExpression = 216, + ExpressionWithTypeArguments = 217, + AsExpression = 218, + NonNullExpression = 219, + MetaProperty = 220, + SyntheticExpression = 221, + TemplateSpan = 222, + SemicolonClassElement = 223, + Block = 224, + EmptyStatement = 225, + VariableStatement = 226, + ExpressionStatement = 227, + IfStatement = 228, + DoStatement = 229, + WhileStatement = 230, + ForStatement = 231, + ForInStatement = 232, + ForOfStatement = 233, + ContinueStatement = 234, + BreakStatement = 235, + ReturnStatement = 236, + WithStatement = 237, + SwitchStatement = 238, + LabeledStatement = 239, + ThrowStatement = 240, + TryStatement = 241, + DebuggerStatement = 242, + VariableDeclaration = 243, + VariableDeclarationList = 244, + FunctionDeclaration = 245, + ClassDeclaration = 246, + InterfaceDeclaration = 247, + TypeAliasDeclaration = 248, + EnumDeclaration = 249, + ModuleDeclaration = 250, + ModuleBlock = 251, + CaseBlock = 252, + NamespaceExportDeclaration = 253, + ImportEqualsDeclaration = 254, + ImportDeclaration = 255, + ImportClause = 256, + NamespaceImport = 257, + NamedImports = 258, + ImportSpecifier = 259, + ExportAssignment = 260, + ExportDeclaration = 261, + NamedExports = 262, + NamespaceExport = 263, + ExportSpecifier = 264, + MissingDeclaration = 265, + ExternalModuleReference = 266, + JsxElement = 267, + JsxSelfClosingElement = 268, + JsxOpeningElement = 269, + JsxClosingElement = 270, + JsxFragment = 271, + JsxOpeningFragment = 272, + JsxClosingFragment = 273, + JsxAttribute = 274, + JsxAttributes = 275, + JsxSpreadAttribute = 276, + JsxExpression = 277, + CaseClause = 278, + DefaultClause = 279, + HeritageClause = 280, + CatchClause = 281, + PropertyAssignment = 282, + ShorthandPropertyAssignment = 283, + SpreadAssignment = 284, + EnumMember = 285, + UnparsedPrologue = 286, + UnparsedPrepend = 287, + UnparsedText = 288, + UnparsedInternalText = 289, + UnparsedSyntheticReference = 290, + SourceFile = 291, + Bundle = 292, + UnparsedSource = 293, + InputFiles = 294, + JSDocTypeExpression = 295, + JSDocAllType = 296, + JSDocUnknownType = 297, + JSDocNullableType = 298, + JSDocNonNullableType = 299, + JSDocOptionalType = 300, + JSDocFunctionType = 301, + JSDocVariadicType = 302, + JSDocNamepathType = 303, + JSDocComment = 304, + JSDocTypeLiteral = 305, + JSDocSignature = 306, + JSDocTag = 307, + JSDocAugmentsTag = 308, + JSDocImplementsTag = 309, + JSDocAuthorTag = 310, + JSDocClassTag = 311, + JSDocPublicTag = 312, + JSDocPrivateTag = 313, + JSDocProtectedTag = 314, + JSDocReadonlyTag = 315, + JSDocCallbackTag = 316, + JSDocEnumTag = 317, + JSDocParameterTag = 318, + JSDocReturnTag = 319, + JSDocThisTag = 320, + JSDocTypeTag = 321, + JSDocTemplateTag = 322, + JSDocTypedefTag = 323, + JSDocPropertyTag = 324, + SyntaxList = 325, + NotEmittedStatement = 326, + PartiallyEmittedExpression = 327, + CommaListExpression = 328, + MergeDeclarationMarker = 329, + EndOfDeclarationMarker = 330, + SyntheticReferenceExpression = 331, + Count = 332, FirstAssignment = 62, LastAssignment = 74, FirstCompoundAssignment = 63, @@ -418,7 +419,7 @@ declare namespace ts { FirstFutureReservedWord = 113, LastFutureReservedWord = 121, FirstTypeNode = 168, - LastTypeNode = 188, + LastTypeNode = 189, FirstPunctuation = 18, LastPunctuation = 74, FirstToken = 0, @@ -431,13 +432,13 @@ declare namespace ts { LastTemplateToken = 17, FirstBinaryOperator = 29, LastBinaryOperator = 74, - FirstStatement = 225, - LastStatement = 241, + FirstStatement = 226, + LastStatement = 242, FirstNode = 153, - FirstJSDocNode = 294, - LastJSDocNode = 323, - FirstJSDocTagNode = 306, - LastJSDocTagNode = 323, + FirstJSDocNode = 295, + LastJSDocNode = 324, + FirstJSDocTagNode = 307, + LastJSDocTagNode = 324, } export enum NodeFlags { None = 0, @@ -507,7 +508,7 @@ declare namespace ts { } export interface JSDocContainer { } - export type HasJSDoc = ParameterDeclaration | CallSignatureDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | LabeledStatement | ExpressionStatement | VariableStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | PropertyDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | ExportDeclaration | EndOfFileToken; + export type HasJSDoc = ParameterDeclaration | CallSignatureDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | LabeledStatement | ExpressionStatement | VariableStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | PropertyDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | ExportDeclaration | NamedTupleMember | EndOfFileToken; export type HasType = SignatureDeclaration | VariableDeclaration | ParameterDeclaration | PropertySignature | PropertyDeclaration | TypePredicateNode | ParenthesizedTypeNode | TypeOperatorNode | MappedTypeNode | AssertionExpression | TypeAliasDeclaration | JSDocTypeExpression | JSDocNonNullableType | JSDocNullableType | JSDocOptionalType | JSDocVariadicType; export type HasTypeArguments = CallExpression | NewExpression | TaggedTemplateExpression | JsxOpeningElement | JsxSelfClosingElement; export type HasInitializer = HasExpressionInitializer | ForStatement | ForInStatement | ForOfStatement | JsxAttribute; @@ -808,7 +809,14 @@ declare namespace ts { } export interface TupleTypeNode extends TypeNode { kind: SyntaxKind.TupleType; - elementTypes: NodeArray; + elements: NodeArray; + } + export interface NamedTupleMember extends TypeNode, JSDocContainer { + kind: SyntaxKind.NamedTupleMember; + dotDotDotToken?: Token; + name: Identifier; + questionToken?: Token; + type: TypeNode; } export interface OptionalTypeNode extends TypeNode { kind: SyntaxKind.OptionalType; @@ -3232,7 +3240,8 @@ declare namespace ts { HeritageClauses = 512, SingleLineTypeLiteralMembers = 768, MultiLineTypeLiteralMembers = 32897, - TupleTypeElements = 528, + SingleLineTupleTypeElements = 528, + MultiLineTupleTypeElements = 657, UnionTypeConstituents = 516, IntersectionTypeConstituents = 520, ObjectBindingPatternElements = 525136, @@ -4052,8 +4061,8 @@ declare namespace ts { function updateTypeLiteralNode(node: TypeLiteralNode, members: NodeArray): TypeLiteralNode; function createArrayTypeNode(elementType: TypeNode): ArrayTypeNode; function updateArrayTypeNode(node: ArrayTypeNode, elementType: TypeNode): ArrayTypeNode; - function createTupleTypeNode(elementTypes: readonly TypeNode[]): TupleTypeNode; - function updateTupleTypeNode(node: TupleTypeNode, elementTypes: readonly TypeNode[]): TupleTypeNode; + function createTupleTypeNode(elements: readonly (TypeNode | NamedTupleMember)[]): TupleTypeNode; + function updateTupleTypeNode(node: TupleTypeNode, elements: readonly (TypeNode | NamedTupleMember)[]): TupleTypeNode; function createOptionalTypeNode(type: TypeNode): OptionalTypeNode; function updateOptionalTypeNode(node: OptionalTypeNode, type: TypeNode): OptionalTypeNode; function createRestTypeNode(type: TypeNode): RestTypeNode; @@ -4071,6 +4080,8 @@ declare namespace ts { function updateImportTypeNode(node: ImportTypeNode, argument: TypeNode, qualifier?: EntityName, typeArguments?: readonly TypeNode[], isTypeOf?: boolean): ImportTypeNode; function createParenthesizedType(type: TypeNode): ParenthesizedTypeNode; function updateParenthesizedType(node: ParenthesizedTypeNode, type: TypeNode): ParenthesizedTypeNode; + function createNamedTupleMember(name: Identifier, type: TypeNode): NamedTupleMember; + function updateNamedTupleMember(node: NamedTupleMember, name: Identifier, type: TypeNode): NamedTupleMember; function createThisTypeNode(): ThisTypeNode; function createTypeOperatorNode(type: TypeNode): TypeOperatorNode; function createTypeOperatorNode(operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword, type: TypeNode): TypeOperatorNode; diff --git a/tests/baselines/reference/genericRestParameters1.types b/tests/baselines/reference/genericRestParameters1.types index c9067b38c974d..95b490a564610 100644 --- a/tests/baselines/reference/genericRestParameters1.types +++ b/tests/baselines/reference/genericRestParameters1.types @@ -665,23 +665,23 @@ const c30 = f30(42, x => "" + x, x => x + 1); // [(x: number) => string, (x: nu >1 : 1 type T01 = Parameters<(x: number, y: string, z: boolean) => void>; ->T01 : [number, string, boolean] +>T01 : [x: number, y: string, z: boolean] >x : number >y : string >z : boolean type T02 = Parameters<(...args: [number, string, boolean]) => void>; ->T02 : [number, string, boolean] +>T02 : [args_0: number, args_1: string, args_2: boolean] >args : [number, string, boolean] type T03 = ConstructorParameters void>; ->T03 : [number, string, boolean] +>T03 : [x: number, y: string, z: boolean] >x : number >y : string >z : boolean type T04 = ConstructorParameters void>; ->T04 : [number, string, boolean] +>T04 : [args_0: number, args_1: string, args_2: boolean] >args : [number, string, boolean] type T05 = Parameters<(...args: T[]) => void>; diff --git a/tests/baselines/reference/genericRestParameters2.types b/tests/baselines/reference/genericRestParameters2.types index 16798357a92a7..12694bbda7d07 100644 --- a/tests/baselines/reference/genericRestParameters2.types +++ b/tests/baselines/reference/genericRestParameters2.types @@ -417,23 +417,23 @@ f20(42, "hello", ...t2, true); >true : true type T01 = Parameters<(x: number, y: string, ...z: boolean[]) => void>; ->T01 : [number, string, ...boolean[]] +>T01 : [x: number, y: string, z: ...boolean[]] >x : number >y : string >z : boolean[] type T02 = Parameters<(...args: [number, string, ...boolean[]]) => void>; ->T02 : [number, string, ...boolean[]] +>T02 : [args_0: number, args_1: string, args_2: ...boolean[]] >args : [number, string, ...boolean[]] type T03 = ConstructorParameters void>; ->T03 : [number, string, ...boolean[]] +>T03 : [x: number, y: string, z: ...boolean[]] >x : number >y : string >z : boolean[] type T04 = ConstructorParameters void>; ->T04 : [number, string, ...boolean[]] +>T04 : [args_0: number, args_1: string, args_2: ...boolean[]] >args : [number, string, ...boolean[]] type T05 = Parameters<(x: string, ...args: T) => void>; @@ -442,7 +442,7 @@ type T05 = Parameters<(x: string, ...args: T) => void>; >args : T type T06 = T05<[number, ...boolean[]]>; ->T06 : [string, number, ...boolean[]] +>T06 : [x: string, args_0: number, args_1: ...boolean[]] type P1 = T extends (head: infer A, ...tail: infer B) => any ? { head: A, tail: B } : any[]; >P1 : P1 @@ -452,7 +452,7 @@ type P1 = T extends (head: infer A, ...tail: infer B) => any >tail : B type T10 = P1<(x: number, y: string, ...z: boolean[]) => void>; ->T10 : { head: number; tail: [string, ...boolean[]]; } +>T10 : { head: number; tail: [y: string, z: ...boolean[]]; } >x : number >y : string >z : boolean[] @@ -462,7 +462,7 @@ type T11 = P1<(...z: number[]) => void>; >z : number[] type T12 = P1<(x: number, y: number) => void>; ->T12 : { head: number; tail: [number]; } +>T12 : { head: number; tail: [y: number]; } >x : number >y : number diff --git a/tests/baselines/reference/genericRestParameters3.errors.txt b/tests/baselines/reference/genericRestParameters3.errors.txt index 9e3e9d97de42d..4b7032bb13b33 100644 --- a/tests/baselines/reference/genericRestParameters3.errors.txt +++ b/tests/baselines/reference/genericRestParameters3.errors.txt @@ -6,20 +6,20 @@ tests/cases/conformance/types/rest/genericRestParameters3.ts(18,1): error TS2345 tests/cases/conformance/types/rest/genericRestParameters3.ts(22,1): error TS2322: Type '(x: string, ...args: [string] | [number, boolean]) => void' is not assignable to type '(...args: [string, string] | [string, number, boolean]) => void'. tests/cases/conformance/types/rest/genericRestParameters3.ts(23,1): error TS2322: Type '(x: string, y: string) => void' is not assignable to type '(x: string, ...args: [string] | [number, boolean]) => void'. Types of parameters 'y' and 'args' are incompatible. - Type '[string] | [number, boolean]' is not assignable to type '[string]'. - Type '[number, boolean]' is not assignable to type '[string]'. + Type '[string] | [number, boolean]' is not assignable to type '[y: string]'. + Type '[number, boolean]' is not assignable to type '[y: string]'. Types of property '0' are incompatible. Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/rest/genericRestParameters3.ts(24,1): error TS2322: Type '(x: string, y: number, z: boolean) => void' is not assignable to type '(x: string, ...args: [string] | [number, boolean]) => void'. Types of parameters 'y' and 'args' are incompatible. - Type '[string] | [number, boolean]' is not assignable to type '[number, boolean]'. - Property '1' is missing in type '[string]' but required in type '[number, boolean]'. + Type '[string] | [number, boolean]' is not assignable to type '[y: number, z: boolean]'. + Property '1' is missing in type '[string]' but required in type '[y: number, z: boolean]'. tests/cases/conformance/types/rest/genericRestParameters3.ts(25,1): error TS2322: Type '(...args: [string, string] | [string, number, boolean]) => void' is not assignable to type '(x: string, ...args: [string] | [number, boolean]) => void'. tests/cases/conformance/types/rest/genericRestParameters3.ts(35,1): error TS2554: Expected 1 arguments, but got 0. tests/cases/conformance/types/rest/genericRestParameters3.ts(36,21): error TS2345: Argument of type '100' is not assignable to parameter of type '(...args: CoolArray) => void'. tests/cases/conformance/types/rest/genericRestParameters3.ts(37,21): error TS2345: Argument of type '(cb: (...args: T) => void) => void' is not assignable to parameter of type '(...args: CoolArray) => void'. Types of parameters 'cb' and 'args' are incompatible. - Property '0' is missing in type 'CoolArray' but required in type '[(...args: any[]) => void]'. + Property '0' is missing in type 'CoolArray' but required in type '[cb: (...args: any[]) => void]'. tests/cases/conformance/types/rest/genericRestParameters3.ts(44,32): error TS2345: Argument of type '[10, 20]' is not assignable to parameter of type 'CoolArray'. Property 'hello' is missing in type '[10, 20]' but required in type 'CoolArray'. tests/cases/conformance/types/rest/genericRestParameters3.ts(49,1): error TS2345: Argument of type '[]' is not assignable to parameter of type 'CoolArray'. @@ -70,16 +70,16 @@ tests/cases/conformance/types/rest/genericRestParameters3.ts(59,5): error TS2345 ~~ !!! error TS2322: Type '(x: string, y: string) => void' is not assignable to type '(x: string, ...args: [string] | [number, boolean]) => void'. !!! error TS2322: Types of parameters 'y' and 'args' are incompatible. -!!! error TS2322: Type '[string] | [number, boolean]' is not assignable to type '[string]'. -!!! error TS2322: Type '[number, boolean]' is not assignable to type '[string]'. +!!! error TS2322: Type '[string] | [number, boolean]' is not assignable to type '[y: string]'. +!!! error TS2322: Type '[number, boolean]' is not assignable to type '[y: string]'. !!! error TS2322: Types of property '0' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. f1 = f3; // Error ~~ !!! error TS2322: Type '(x: string, y: number, z: boolean) => void' is not assignable to type '(x: string, ...args: [string] | [number, boolean]) => void'. !!! error TS2322: Types of parameters 'y' and 'args' are incompatible. -!!! error TS2322: Type '[string] | [number, boolean]' is not assignable to type '[number, boolean]'. -!!! error TS2322: Property '1' is missing in type '[string]' but required in type '[number, boolean]'. +!!! error TS2322: Type '[string] | [number, boolean]' is not assignable to type '[y: number, z: boolean]'. +!!! error TS2322: Property '1' is missing in type '[string]' but required in type '[y: number, z: boolean]'. f1 = f4; // Error, misaligned complex rest types ~~ !!! error TS2322: Type '(...args: [string, string] | [string, number, boolean]) => void' is not assignable to type '(x: string, ...args: [string] | [number, boolean]) => void'. @@ -103,7 +103,7 @@ tests/cases/conformance/types/rest/genericRestParameters3.ts(59,5): error TS2345 ~~~ !!! error TS2345: Argument of type '(cb: (...args: T) => void) => void' is not assignable to parameter of type '(...args: CoolArray) => void'. !!! error TS2345: Types of parameters 'cb' and 'args' are incompatible. -!!! error TS2345: Property '0' is missing in type 'CoolArray' but required in type '[(...args: any[]) => void]'. +!!! error TS2345: Property '0' is missing in type 'CoolArray' but required in type '[cb: (...args: any[]) => void]'. function bar(...args: T): T { return args; diff --git a/tests/baselines/reference/genericRestTypes.errors.txt b/tests/baselines/reference/genericRestTypes.errors.txt index c0fcb85e49201..81dc4ee4883a0 100644 --- a/tests/baselines/reference/genericRestTypes.errors.txt +++ b/tests/baselines/reference/genericRestTypes.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/genericRestTypes.ts(21,11): error TS2322: Type '(cb: (x: string, ...rest: T) => void) => void' is not assignable to type '(cb: (...args: never) => void) => void'. Types of parameters 'cb' and 'cb' are incompatible. Types of parameters 'args' and 'x' are incompatible. - Type '[string, ...T[number][]]' is not assignable to type 'never'. + Type '[x: string, rest: ...T[number][]]' is not assignable to type 'never'. ==== tests/cases/compiler/genericRestTypes.ts (1 errors) ==== @@ -30,7 +30,7 @@ tests/cases/compiler/genericRestTypes.ts(21,11): error TS2322: Type '(cb: (x: st !!! error TS2322: Type '(cb: (x: string, ...rest: T) => void) => void' is not assignable to type '(cb: (...args: never) => void) => void'. !!! error TS2322: Types of parameters 'cb' and 'cb' are incompatible. !!! error TS2322: Types of parameters 'args' and 'x' are incompatible. -!!! error TS2322: Type '[string, ...T[number][]]' is not assignable to type 'never'. +!!! error TS2322: Type '[x: string, rest: ...T[number][]]' is not assignable to type 'never'. } function assignmentWithComplexRest3() { diff --git a/tests/baselines/reference/genericRestTypes.types b/tests/baselines/reference/genericRestTypes.types index 8d06f4a07732a..d46f303548154 100644 --- a/tests/baselines/reference/genericRestTypes.types +++ b/tests/baselines/reference/genericRestTypes.types @@ -16,7 +16,7 @@ type MyFunctionType = (foo: number, bar: string) => boolean; type Explicit = (...args: Tail>) => ReturnType; // (bar: string) => boolean >Explicit : Explicit ->args : [string] +>args : [bar: string] type Bind1 any> = (...args: Tail>) => ReturnType; >Bind1 : Bind1 diff --git a/tests/baselines/reference/getParameterNameAtPosition.types b/tests/baselines/reference/getParameterNameAtPosition.types index f722d7e5f9533..1e0c92129010b 100644 --- a/tests/baselines/reference/getParameterNameAtPosition.types +++ b/tests/baselines/reference/getParameterNameAtPosition.types @@ -23,7 +23,7 @@ declare function fn(implementation?: (...args: Y) => any): Mock cases(fn(opts => { })); >cases(fn(opts => { })) : void >cases : (tester: Tester) => void ->fn(opts => { }) : Mock<[any]> +>fn(opts => { }) : Mock<[opts: any]> >fn : (implementation?: ((...args: Y) => any) | undefined) => Mock >opts => { } : (opts: any) => void >opts : any diff --git a/tests/baselines/reference/instantiateContextualTypes.types b/tests/baselines/reference/instantiateContextualTypes.types index b5317b6f7561f..d6c380cb7ac6f 100644 --- a/tests/baselines/reference/instantiateContextualTypes.types +++ b/tests/baselines/reference/instantiateContextualTypes.types @@ -444,5 +444,5 @@ assignPartial(obj, { foo(...args) {} }); // args has type [string] >obj : { foo(bar: string): void; } >{ foo(...args) {} } : { foo(bar: string): void; } >foo : (bar: string) => void ->args : [string] +>args : [bar: string] diff --git a/tests/baselines/reference/jsFileCompilationRestParamJsDocFunction.types b/tests/baselines/reference/jsFileCompilationRestParamJsDocFunction.types index ab733f5ab6a8d..c0247bb045fe1 100644 --- a/tests/baselines/reference/jsFileCompilationRestParamJsDocFunction.types +++ b/tests/baselines/reference/jsFileCompilationRestParamJsDocFunction.types @@ -10,7 +10,7 @@ * @returns {*} Returns the result of `func`. */ function apply(func, thisArg, ...args) { ->apply : (func: Function, thisArg: any, ...args: ...*) => any +>apply : (func: Function, thisArg: any, ...args: any[]) => any >func : Function >thisArg : any >args : any[] diff --git a/tests/baselines/reference/jsdocParseDotDotDotInJSDocFunction.types b/tests/baselines/reference/jsdocParseDotDotDotInJSDocFunction.types index 1e9703ccb3100..b015f0f50c3e0 100644 --- a/tests/baselines/reference/jsdocParseDotDotDotInJSDocFunction.types +++ b/tests/baselines/reference/jsdocParseDotDotDotInJSDocFunction.types @@ -2,7 +2,7 @@ // from bcryptjs /** @param {function(...[*])} callback */ function g(callback) { ->g : (callback: (arg0: ...[*]) => ) => void +>g : (callback: (...args: [any][]) => ) => void >callback : (...arg0: [any][]) => any callback([1], [2], [3]) diff --git a/tests/baselines/reference/jsdocParseStarEquals.types b/tests/baselines/reference/jsdocParseStarEquals.types index ac7d7f0164ef5..1142fb05daea3 100644 --- a/tests/baselines/reference/jsdocParseStarEquals.types +++ b/tests/baselines/reference/jsdocParseStarEquals.types @@ -2,7 +2,7 @@ /** @param {...*=} args @return {*=} */ function f(...args) { ->f : (...args: ...*=) => any | undefined +>f : (...args: (any | undefined)[]) => any | undefined >args : any[] return null diff --git a/tests/baselines/reference/jsdocPrefixPostfixParsing.types b/tests/baselines/reference/jsdocPrefixPostfixParsing.types index 1fa8634af7f9a..f13f249121b0a 100644 --- a/tests/baselines/reference/jsdocPrefixPostfixParsing.types +++ b/tests/baselines/reference/jsdocPrefixPostfixParsing.types @@ -15,7 +15,7 @@ * @param {...number?[]!} k - (number[] | null)[] */ function f(x, y, z, a, b, c, e, f, g, h, i, j, k) { ->f : (x: number[], y: number[], z: (number[]), a: (number | null)[], b: number[] | null, c: (number[]) | null, e: ...?number, f: ...?number, g: ...?!number, h: ...!?number, i: ...number[], j: ...?!number[], k: ...!?number[]) => void +>f : (x: number[], y: number[], z: (number[]), a: (number | null)[], b: number[] | null, c: (number[]) | null, e: (number | null)[], f: (number | null)[], g: (number | null)[], h: (number | null)[], i: number[][], j: (number[] | null)[], k: (number | null)[][]) => void >x : number[] >y : number[] >z : number[] diff --git a/tests/baselines/reference/jsdocRestParameter_es6.types b/tests/baselines/reference/jsdocRestParameter_es6.types index faa569a4f2062..b07d7d931f109 100644 --- a/tests/baselines/reference/jsdocRestParameter_es6.types +++ b/tests/baselines/reference/jsdocRestParameter_es6.types @@ -1,7 +1,7 @@ === /a.js === /** @param {...number} a */ function f(...a) { ->f : (...a: ...number) => void +>f : (...a: number[]) => void >a : number[] a; // number[] diff --git a/tests/baselines/reference/lambdaParameterWithTupleArgsHasCorrectAssignability.types b/tests/baselines/reference/lambdaParameterWithTupleArgsHasCorrectAssignability.types index 27d8e5a4cb4ed..435bdc4c4cf93 100644 --- a/tests/baselines/reference/lambdaParameterWithTupleArgsHasCorrectAssignability.types +++ b/tests/baselines/reference/lambdaParameterWithTupleArgsHasCorrectAssignability.types @@ -33,7 +33,7 @@ function consumeClass(c: GenericClass<[string, boolean]>) { } consumeClass(createClass(str => console.log(str.length))); >consumeClass(createClass(str => console.log(str.length))) : void >consumeClass : (c: GenericClass<[string, boolean]>) => void ->createClass(str => console.log(str.length)) : GenericClass<[string]> +>createClass(str => console.log(str.length)) : GenericClass<[str: string]> >createClass : (f: GenericFunction) => GenericClass >str => console.log(str.length) : (str: string) => void >str : string @@ -49,7 +49,7 @@ consumeClass(createClass(str => console.log(str.length))); consumeClass(createClass((str, _unused_num) => console.log(str.length))); >consumeClass(createClass((str, _unused_num) => console.log(str.length))) : void >consumeClass : (c: GenericClass<[string, boolean]>) => void ->createClass((str, _unused_num) => console.log(str.length)) : GenericClass<[string, boolean]> +>createClass((str, _unused_num) => console.log(str.length)) : GenericClass<[str: string, _unused_num: boolean]> >createClass : (f: GenericFunction) => GenericClass >(str, _unused_num) => console.log(str.length) : (str: string, _unused_num: boolean) => void >str : string diff --git a/tests/baselines/reference/namedTupleMembers.js b/tests/baselines/reference/namedTupleMembers.js new file mode 100644 index 0000000000000..ed5fa639a0796 --- /dev/null +++ b/tests/baselines/reference/namedTupleMembers.js @@ -0,0 +1,59 @@ +//// [namedTupleMembers.ts] +export type Segment = [length: number, count: number]; + +export type SegmentAnnotated = [ + /** + * Size of message buffer segment handles + */ + length: number, + /** + * Number of segments handled at once + */ + count: number +]; + +export type Func = (...x: T) => void; + +export const c = null as any as Func; + +export function useState(initial: T): [value: T, setter: (T) => void] { + return null as any; +} + + +export type Iter = Func<[step: number, iterations: number]>; + +export function readSegment([length, count]: [number, number]) {} + +//// [namedTupleMembers.js] +"use strict"; +exports.__esModule = true; +exports.readSegment = exports.useState = exports.c = void 0; +exports.c = null; +function useState(initial) { + return null; +} +exports.useState = useState; +function readSegment(_a) { + var length = _a[0], count = _a[1]; +} +exports.readSegment = readSegment; + + +//// [namedTupleMembers.d.ts] +export declare type Segment = [length: number, count: number]; +export declare type SegmentAnnotated = [ + /** + * Size of message buffer segment handles + */ + length: number, + /** + * Number of segments handled at once + */ + count: number +]; +export declare type Func = (...x: T) => void; +export declare const c: Func; +export declare function useState(initial: T): [value: T, setter: (T: any) => void]; +export declare type Iter = Func<[step: number, iterations: number]>; +export declare function readSegment([length, count]: [number, number]): void; diff --git a/tests/baselines/reference/namedTupleMembers.symbols b/tests/baselines/reference/namedTupleMembers.symbols new file mode 100644 index 0000000000000..267a5e5e06a90 --- /dev/null +++ b/tests/baselines/reference/namedTupleMembers.symbols @@ -0,0 +1,49 @@ +=== tests/cases/conformance/types/tuple/named/namedTupleMembers.ts === +export type Segment = [length: number, count: number]; +>Segment : Symbol(Segment, Decl(namedTupleMembers.ts, 0, 0)) + +export type SegmentAnnotated = [ +>SegmentAnnotated : Symbol(SegmentAnnotated, Decl(namedTupleMembers.ts, 0, 54)) + + /** + * Size of message buffer segment handles + */ + length: number, + /** + * Number of segments handled at once + */ + count: number +]; + +export type Func = (...x: T) => void; +>Func : Symbol(Func, Decl(namedTupleMembers.ts, 11, 2)) +>T : Symbol(T, Decl(namedTupleMembers.ts, 13, 17)) +>x : Symbol(x, Decl(namedTupleMembers.ts, 13, 37)) +>T : Symbol(T, Decl(namedTupleMembers.ts, 13, 17)) + +export const c = null as any as Func; +>c : Symbol(c, Decl(namedTupleMembers.ts, 15, 12)) +>Func : Symbol(Func, Decl(namedTupleMembers.ts, 11, 2)) +>SegmentAnnotated : Symbol(SegmentAnnotated, Decl(namedTupleMembers.ts, 0, 54)) + +export function useState(initial: T): [value: T, setter: (T) => void] { +>useState : Symbol(useState, Decl(namedTupleMembers.ts, 15, 55)) +>T : Symbol(T, Decl(namedTupleMembers.ts, 17, 25)) +>initial : Symbol(initial, Decl(namedTupleMembers.ts, 17, 28)) +>T : Symbol(T, Decl(namedTupleMembers.ts, 17, 25)) +>T : Symbol(T, Decl(namedTupleMembers.ts, 17, 25)) +>T : Symbol(T, Decl(namedTupleMembers.ts, 17, 61)) + + return null as any; +} + + +export type Iter = Func<[step: number, iterations: number]>; +>Iter : Symbol(Iter, Decl(namedTupleMembers.ts, 19, 1)) +>Func : Symbol(Func, Decl(namedTupleMembers.ts, 11, 2)) + +export function readSegment([length, count]: [number, number]) {} +>readSegment : Symbol(readSegment, Decl(namedTupleMembers.ts, 22, 60)) +>length : Symbol(length, Decl(namedTupleMembers.ts, 24, 29)) +>count : Symbol(count, Decl(namedTupleMembers.ts, 24, 36)) + diff --git a/tests/baselines/reference/namedTupleMembers.types b/tests/baselines/reference/namedTupleMembers.types new file mode 100644 index 0000000000000..19ab582bc537e --- /dev/null +++ b/tests/baselines/reference/namedTupleMembers.types @@ -0,0 +1,46 @@ +=== tests/cases/conformance/types/tuple/named/namedTupleMembers.ts === +export type Segment = [length: number, count: number]; +>Segment : Segment + +export type SegmentAnnotated = [ +>SegmentAnnotated : SegmentAnnotated + + /** + * Size of message buffer segment handles + */ + length: number, + /** + * Number of segments handled at once + */ + count: number +]; + +export type Func = (...x: T) => void; +>Func : Func +>x : T + +export const c = null as any as Func; +>c : Func +>null as any as Func : Func +>null as any : any +>null : null + +export function useState(initial: T): [value: T, setter: (T) => void] { +>useState : (initial: T) => [value: T, setter: (T: any) => void] +>initial : T +>T : any + + return null as any; +>null as any : any +>null : null +} + + +export type Iter = Func<[step: number, iterations: number]>; +>Iter : Func<[step: number, iterations: number]> + +export function readSegment([length, count]: [number, number]) {} +>readSegment : ([length, count]: [number, number]) => void +>length : number +>count : number + diff --git a/tests/baselines/reference/namedTupleMembersErrors.errors.txt b/tests/baselines/reference/namedTupleMembersErrors.errors.txt new file mode 100644 index 0000000000000..0d1bc49b39e75 --- /dev/null +++ b/tests/baselines/reference/namedTupleMembersErrors.errors.txt @@ -0,0 +1,27 @@ +tests/cases/conformance/types/tuple/named/namedTupleMembersErrors.ts(1,41): error TS5084: Tuple members must all have names or not have names. +tests/cases/conformance/types/tuple/named/namedTupleMembersErrors.ts(3,32): error TS5084: Tuple members must all have names or not have names. +tests/cases/conformance/types/tuple/named/namedTupleMembersErrors.ts(5,32): error TS5084: Tuple members must all have names or not have names. +tests/cases/conformance/types/tuple/named/namedTupleMembersErrors.ts(7,20): error TS5085: Tuple members express optionality with a trailing question mark on the type, a question mark on the member name is invalid. +tests/cases/conformance/types/tuple/named/namedTupleMembersErrors.ts(9,41): error TS5086: Rest tuple members are declared with a `...` on the type. A `...` on the name is invalid. + + +==== tests/cases/conformance/types/tuple/named/namedTupleMembersErrors.ts (5 errors) ==== + export type Segment1 = [length: number, number]; // partially named, disallowed + ~~~~~~ +!!! error TS5084: Tuple members must all have names or not have names. + + export type List = [item: any, ...any]; // partially named, disallowed + ~~~~~~ +!!! error TS5084: Tuple members must all have names or not have names. + + export type Pair = [item: any, any?]; // partially named, disallowed + ~~~~ +!!! error TS5084: Tuple members must all have names or not have names. + + export type Opt = [element?: string]; // question mark on name disallowed + ~~~~~~~~~~~~~~~~ +!!! error TS5085: Tuple members express optionality with a trailing question mark on the type, a question mark on the member name is invalid. + + export type Trailing = [first: string, ...rest: string[]] // dots on name disallowed + ~~~~~~~~~~~~~~~~~ +!!! error TS5086: Rest tuple members are declared with a `...` on the type. A `...` on the name is invalid. \ No newline at end of file diff --git a/tests/baselines/reference/namedTupleMembersErrors.js b/tests/baselines/reference/namedTupleMembersErrors.js new file mode 100644 index 0000000000000..e8a830f6673af --- /dev/null +++ b/tests/baselines/reference/namedTupleMembersErrors.js @@ -0,0 +1,22 @@ +//// [namedTupleMembersErrors.ts] +export type Segment1 = [length: number, number]; // partially named, disallowed + +export type List = [item: any, ...any]; // partially named, disallowed + +export type Pair = [item: any, any?]; // partially named, disallowed + +export type Opt = [element?: string]; // question mark on name disallowed + +export type Trailing = [first: string, ...rest: string[]] // dots on name disallowed + +//// [namedTupleMembersErrors.js] +"use strict"; +exports.__esModule = true; + + +//// [namedTupleMembersErrors.d.ts] +export declare type Segment1 = [length: number, number]; +export declare type List = [item: any, ...any]; +export declare type Pair = [item: any, any?]; +export declare type Opt = [element: string]; +export declare type Trailing = [first: string, rest: string[]]; diff --git a/tests/baselines/reference/namedTupleMembersErrors.symbols b/tests/baselines/reference/namedTupleMembersErrors.symbols new file mode 100644 index 0000000000000..e189a8cda2641 --- /dev/null +++ b/tests/baselines/reference/namedTupleMembersErrors.symbols @@ -0,0 +1,16 @@ +=== tests/cases/conformance/types/tuple/named/namedTupleMembersErrors.ts === +export type Segment1 = [length: number, number]; // partially named, disallowed +>Segment1 : Symbol(Segment1, Decl(namedTupleMembersErrors.ts, 0, 0)) + +export type List = [item: any, ...any]; // partially named, disallowed +>List : Symbol(List, Decl(namedTupleMembersErrors.ts, 0, 48)) + +export type Pair = [item: any, any?]; // partially named, disallowed +>Pair : Symbol(Pair, Decl(namedTupleMembersErrors.ts, 2, 39)) + +export type Opt = [element?: string]; // question mark on name disallowed +>Opt : Symbol(Opt, Decl(namedTupleMembersErrors.ts, 4, 37)) + +export type Trailing = [first: string, ...rest: string[]] // dots on name disallowed +>Trailing : Symbol(Trailing, Decl(namedTupleMembersErrors.ts, 6, 37)) + diff --git a/tests/baselines/reference/namedTupleMembersErrors.types b/tests/baselines/reference/namedTupleMembersErrors.types new file mode 100644 index 0000000000000..79b8761d8cbe1 --- /dev/null +++ b/tests/baselines/reference/namedTupleMembersErrors.types @@ -0,0 +1,16 @@ +=== tests/cases/conformance/types/tuple/named/namedTupleMembersErrors.ts === +export type Segment1 = [length: number, number]; // partially named, disallowed +>Segment1 : Segment1 + +export type List = [item: any, ...any]; // partially named, disallowed +>List : List + +export type Pair = [item: any, any?]; // partially named, disallowed +>Pair : Pair + +export type Opt = [element?: string]; // question mark on name disallowed +>Opt : Opt + +export type Trailing = [first: string, ...rest: string[]] // dots on name disallowed +>Trailing : Trailing + diff --git a/tests/baselines/reference/parameterListAsTupleType.types b/tests/baselines/reference/parameterListAsTupleType.types index 3bb861f5a1deb..a9c3c15697b4f 100644 --- a/tests/baselines/reference/parameterListAsTupleType.types +++ b/tests/baselines/reference/parameterListAsTupleType.types @@ -8,7 +8,7 @@ function foo(a: number, b: string) { >true : true } type Foops = Parameters; ->Foops : [number, string] +>Foops : [a: number, b: string] >foo : (a: number, b: string) => boolean const x = (a: number) => 5; @@ -18,17 +18,17 @@ const x = (a: number) => 5; >5 : 5 type Xps = Parameters; ->Xps : [number] +>Xps : [a: number] >x : (a: number) => number const a: Xps = ['should-not-work']; // works, but shouldn't ->a : [number] +>a : [a: number] >['should-not-work'] : [string] >'should-not-work' : "should-not-work" function t(...args: Xps) {} // should work >t : (a: number) => void ->args : [number] +>args : [a: number] class C { >C : C @@ -44,7 +44,7 @@ type Cps = Parameters; // should not work >C : typeof C type Ccps = ConstructorParameters; // should be [number, string] ->Ccps : [number, string] +>Ccps : [a: number, b: string] >C : typeof C class D { @@ -56,6 +56,6 @@ class D { } } type Dcps = ConstructorParameters; // should be [number, ...string[]] ->Dcps : [number, ...string[]] +>Dcps : [a: number, rest: ...string[]] >D : typeof D diff --git a/tests/baselines/reference/partiallyAnnotatedFunctionInferenceWithTypeParameter.types b/tests/baselines/reference/partiallyAnnotatedFunctionInferenceWithTypeParameter.types index 94eabc48b8f0a..818bfb1cff824 100644 --- a/tests/baselines/reference/partiallyAnnotatedFunctionInferenceWithTypeParameter.types +++ b/tests/baselines/reference/partiallyAnnotatedFunctionInferenceWithTypeParameter.types @@ -105,7 +105,7 @@ testRest((t2: D, ...t3) => {}) >testRest : (a: (t: T, t1: T, ...ts: T[]) => void) => T >(t2: D, ...t3) => {} : (t2: D, t1: D, ...ts: D[]) => void >t2 : D ->t3 : [D, ...D[]] +>t3 : [t1: D, ts: ...D[]] testRest((t2, ...t3: D[]) => {}) >testRest((t2, ...t3: D[]) => {}) : C diff --git a/tests/baselines/reference/ramdaToolsNoInfinite.types b/tests/baselines/reference/ramdaToolsNoInfinite.types index 229bdfe4c4053..112d10207b560 100644 --- a/tests/baselines/reference/ramdaToolsNoInfinite.types +++ b/tests/baselines/reference/ramdaToolsNoInfinite.types @@ -128,12 +128,12 @@ declare namespace Tools { ]; type Concat = ->Concat : { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[11 extends (any[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: Prepend<(any[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[9], Prepend<(any[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[8], Prepend<(any[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[7], Prepend<(any[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[6], Prepend<(any[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[5], Prepend<(any[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[4], Prepend<(any[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[3], Prepend<(any[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[2], Prepend<(any[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[1], Prepend<(any[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[0], T2>>>>>>>>>>; }[10 extends ({ 0: any[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: Prepend<({ 0: any[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[8], Prepend<({ 0: any[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[7], Prepend<({ 0: any[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[6], Prepend<({ 0: any[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[5], Prepend<({ 0: any[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[4], Prepend<({ 0: any[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[3], Prepend<({ 0: any[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[2], Prepend<({ 0: any[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[1], Prepend<({ 0: any[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[0], T2>>>>>>>>>; }[9 extends ({ 0: { 0: any[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: Prepend<({ 0: { 0: any[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[7], Prepend<({ 0: { 0: any[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[6], Prepend<({ 0: { 0: any[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[5], Prepend<({ 0: { 0: any[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[4], Prepend<({ 0: { 0: any[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[3], Prepend<({ 0: { 0: any[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[2], Prepend<({ 0: { 0: any[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[1], Prepend<({ 0: { 0: any[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[0], T2>>>>>>>>; }[8 extends ({ 0: { 0: { 0: any[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: Prepend<({ 0: { 0: { 0: any[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[6], Prepend<({ 0: { 0: { 0: any[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[5], Prepend<({ 0: { 0: { 0: any[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[4], Prepend<({ 0: { 0: { 0: any[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[3], Prepend<({ 0: { 0: { 0: any[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[2], Prepend<({ 0: { 0: { 0: any[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[1], Prepend<({ 0: { 0: { 0: any[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[0], T2>>>>>>>; }[7 extends ({ 0: { 0: { 0: { 0: any[4 extends T1["length"] ? 1 : 0]; 1: [T1[2], T1[1], T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: Prepend<({ 0: { 0: { 0: { 0: any[4 extends T1["length"] ? 1 : 0]; 1: [T1[2], T1[1], T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[5], Prepend<({ 0: { 0: { 0: { 0: any[4 extends T1["length"] ? 1 : 0]; 1: [T1[2], T1[1], T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[4], Prepend<({ 0: { 0: { 0: { 0: any[4 extends T1["length"] ? 1 : 0]; 1: [T1[2], T1[1], T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[3], Prepend<({ 0: { 0: { 0: { 0: any[4 extends T1["length"] ? 1 : 0]; 1: [T1[2], T1[1], T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[2], Prepend<({ 0: { 0: { 0: { 0: any[4 extends T1["length"] ? 1 : 0]; 1: [T1[2], T1[1], T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[1], Prepend<({ 0: { 0: { 0: { 0: any[4 extends T1["length"] ? 1 : 0]; 1: [T1[2], T1[1], T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[0], T2>>>>>>; }[6 extends ({ 0: { 0: { 0: { 0: { 0: any[5 extends T1["length"] ? 1 : 0]; 1: [T1[3], T1[2], T1[1], T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [T1[2], T1[1], T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: Prepend<({ 0: { 0: { 0: { 0: { 0: any[5 extends T1["length"] ? 1 : 0]; 1: [T1[3], T1[2], T1[1], T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [T1[2], T1[1], T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[4], Prepend<({ 0: { 0: { 0: { 0: { 0: any[5 extends T1["length"] ? 1 : 0]; 1: [T1[3], T1[2], T1[1], T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [T1[2], T1[1], T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[3], Prepend<({ 0: { 0: { 0: { 0: { 0: any[5 extends T1["length"] ? 1 : 0]; 1: [T1[3], T1[2], T1[1], T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [T1[2], T1[1], T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[2], Prepend<({ 0: { 0: { 0: { 0: { 0: any[5 extends T1["length"] ? 1 : 0]; 1: [T1[3], T1[2], T1[1], T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [T1[2], T1[1], T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[1], Prepend<({ 0: { 0: { 0: { 0: { 0: any[5 extends T1["length"] ? 1 : 0]; 1: [T1[3], T1[2], T1[1], T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [T1[2], T1[1], T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[0], T2>>>>>; }[5 extends ({ 0: { 0: { 0: { 0: { 0: { 0: any[6 extends T1["length"] ? 1 : 0]; 1: [T1[4], T1[3], T1[2], T1[1], T1[0]]; }[5 extends T1["length"] ? 1 : 0]; 1: [T1[3], T1[2], T1[1], T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [T1[2], T1[1], T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: Prepend<({ 0: { 0: { 0: { 0: { 0: { 0: any[6 extends T1["length"] ? 1 : 0]; 1: [T1[4], T1[3], T1[2], T1[1], T1[0]]; }[5 extends T1["length"] ? 1 : 0]; 1: [T1[3], T1[2], T1[1], T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [T1[2], T1[1], T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[3], Prepend<({ 0: { 0: { 0: { 0: { 0: { 0: any[6 extends T1["length"] ? 1 : 0]; 1: [T1[4], T1[3], T1[2], T1[1], T1[0]]; }[5 extends T1["length"] ? 1 : 0]; 1: [T1[3], T1[2], T1[1], T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [T1[2], T1[1], T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[2], Prepend<({ 0: { 0: { 0: { 0: { 0: { 0: any[6 extends T1["length"] ? 1 : 0]; 1: [T1[4], T1[3], T1[2], T1[1], T1[0]]; }[5 extends T1["length"] ? 1 : 0]; 1: [T1[3], T1[2], T1[1], T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [T1[2], T1[1], T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[1], Prepend<({ 0: { 0: { 0: { 0: { 0: { 0: any[6 extends T1["length"] ? 1 : 0]; 1: [T1[4], T1[3], T1[2], T1[1], T1[0]]; }[5 extends T1["length"] ? 1 : 0]; 1: [T1[3], T1[2], T1[1], T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [T1[2], T1[1], T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[0], T2>>>>; }[4 extends ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: any[7 extends T1["length"] ? 1 : 0]; 1: [T1[5], T1[4], T1[3], T1[2], T1[1], T1[0]]; }[6 extends T1["length"] ? 1 : 0]; 1: [T1[4], T1[3], T1[2], T1[1], T1[0]]; }[5 extends T1["length"] ? 1 : 0]; 1: [T1[3], T1[2], T1[1], T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [T1[2], T1[1], T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: Prepend<({ 0: { 0: { 0: { 0: { 0: { 0: { 0: any[7 extends T1["length"] ? 1 : 0]; 1: [T1[5], T1[4], T1[3], T1[2], T1[1], T1[0]]; }[6 extends T1["length"] ? 1 : 0]; 1: [T1[4], T1[3], T1[2], T1[1], T1[0]]; }[5 extends T1["length"] ? 1 : 0]; 1: [T1[3], T1[2], T1[1], T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [T1[2], T1[1], T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[2], Prepend<({ 0: { 0: { 0: { 0: { 0: { 0: { 0: any[7 extends T1["length"] ? 1 : 0]; 1: [T1[5], T1[4], T1[3], T1[2], T1[1], T1[0]]; }[6 extends T1["length"] ? 1 : 0]; 1: [T1[4], T1[3], T1[2], T1[1], T1[0]]; }[5 extends T1["length"] ? 1 : 0]; 1: [T1[3], T1[2], T1[1], T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [T1[2], T1[1], T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[1], Prepend<({ 0: { 0: { 0: { 0: { 0: { 0: { 0: any[7 extends T1["length"] ? 1 : 0]; 1: [T1[5], T1[4], T1[3], T1[2], T1[1], T1[0]]; }[6 extends T1["length"] ? 1 : 0]; 1: [T1[4], T1[3], T1[2], T1[1], T1[0]]; }[5 extends T1["length"] ? 1 : 0]; 1: [T1[3], T1[2], T1[1], T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [T1[2], T1[1], T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[0], T2>>>; }[3 extends ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[8 extends T1["length"] ? 1 : 0]; 1: [T1[6], T1[5], T1[4], T1[3], T1[2], T1[1], T1[0]]; }[7 extends T1["length"] ? 1 : 0]; 1: [T1[5], T1[4], T1[3], T1[2], T1[1], T1[0]]; }[6 extends T1["length"] ? 1 : 0]; 1: [T1[4], T1[3], T1[2], T1[1], T1[0]]; }[5 extends T1["length"] ? 1 : 0]; 1: [T1[3], T1[2], T1[1], T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [T1[2], T1[1], T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: Prepend<({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[8 extends T1["length"] ? 1 : 0]; 1: [T1[6], T1[5], T1[4], T1[3], T1[2], T1[1], T1[0]]; }[7 extends T1["length"] ? 1 : 0]; 1: [T1[5], T1[4], T1[3], T1[2], T1[1], T1[0]]; }[6 extends T1["length"] ? 1 : 0]; 1: [T1[4], T1[3], T1[2], T1[1], T1[0]]; }[5 extends T1["length"] ? 1 : 0]; 1: [T1[3], T1[2], T1[1], T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [T1[2], T1[1], T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[1], Prepend<({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[8 extends T1["length"] ? 1 : 0]; 1: [T1[6], T1[5], T1[4], T1[3], T1[2], T1[1], T1[0]]; }[7 extends T1["length"] ? 1 : 0]; 1: [T1[5], T1[4], T1[3], T1[2], T1[1], T1[0]]; }[6 extends T1["length"] ? 1 : 0]; 1: [T1[4], T1[3], T1[2], T1[1], T1[0]]; }[5 extends T1["length"] ? 1 : 0]; 1: [T1[3], T1[2], T1[1], T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [T1[2], T1[1], T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[0], T2>>; }[2 extends ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[9 extends T1["length"] ? 1 : 0]; 1: [T1[7], T1[6], T1[5], T1[4], T1[3], T1[2], T1[1], T1[0]]; }[8 extends T1["length"] ? 1 : 0]; 1: [T1[6], T1[5], T1[4], T1[3], T1[2], T1[1], T1[0]]; }[7 extends T1["length"] ? 1 : 0]; 1: [T1[5], T1[4], T1[3], T1[2], T1[1], T1[0]]; }[6 extends T1["length"] ? 1 : 0]; 1: [T1[4], T1[3], T1[2], T1[1], T1[0]]; }[5 extends T1["length"] ? 1 : 0]; 1: [T1[3], T1[2], T1[1], T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [T1[2], T1[1], T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: Prepend<({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[9 extends T1["length"] ? 1 : 0]; 1: [T1[7], T1[6], T1[5], T1[4], T1[3], T1[2], T1[1], T1[0]]; }[8 extends T1["length"] ? 1 : 0]; 1: [T1[6], T1[5], T1[4], T1[3], T1[2], T1[1], T1[0]]; }[7 extends T1["length"] ? 1 : 0]; 1: [T1[5], T1[4], T1[3], T1[2], T1[1], T1[0]]; }[6 extends T1["length"] ? 1 : 0]; 1: [T1[4], T1[3], T1[2], T1[1], T1[0]]; }[5 extends T1["length"] ? 1 : 0]; 1: [T1[3], T1[2], T1[1], T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [T1[2], T1[1], T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[0], T2>; }[1 extends ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[10 extends T1["length"] ? 1 : 0]; 1: [T1[8], T1[7], T1[6], T1[5], T1[4], T1[3], T1[2], T1[1], T1[0]]; }[9 extends T1["length"] ? 1 : 0]; 1: [T1[7], T1[6], T1[5], T1[4], T1[3], T1[2], T1[1], T1[0]]; }[8 extends T1["length"] ? 1 : 0]; 1: [T1[6], T1[5], T1[4], T1[3], T1[2], T1[1], T1[0]]; }[7 extends T1["length"] ? 1 : 0]; 1: [T1[5], T1[4], T1[3], T1[2], T1[1], T1[0]]; }[6 extends T1["length"] ? 1 : 0]; 1: [T1[4], T1[3], T1[2], T1[1], T1[0]]; }[5 extends T1["length"] ? 1 : 0]; 1: [T1[3], T1[2], T1[1], T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [T1[2], T1[1], T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: T2; }[0 extends ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[11 extends T1["length"] ? 1 : 0]; 1: [T1[9], T1[8], T1[7], T1[6], T1[5], T1[4], T1[3], T1[2], T1[1], T1[0]]; }[10 extends T1["length"] ? 1 : 0]; 1: [T1[8], T1[7], T1[6], T1[5], T1[4], T1[3], T1[2], T1[1], T1[0]]; }[9 extends T1["length"] ? 1 : 0]; 1: [T1[7], T1[6], T1[5], T1[4], T1[3], T1[2], T1[1], T1[0]]; }[8 extends T1["length"] ? 1 : 0]; 1: [T1[6], T1[5], T1[4], T1[3], T1[2], T1[1], T1[0]]; }[7 extends T1["length"] ? 1 : 0]; 1: [T1[5], T1[4], T1[3], T1[2], T1[1], T1[0]]; }[6 extends T1["length"] ? 1 : 0]; 1: [T1[4], T1[3], T1[2], T1[1], T1[0]]; }[5 extends T1["length"] ? 1 : 0]; 1: [T1[3], T1[2], T1[1], T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [T1[2], T1[1], T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [T1[1], T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0] +>Concat : { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[11 extends (any[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: Prepend<(any[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[9], Prepend<(any[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[8], Prepend<(any[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[7], Prepend<(any[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[6], Prepend<(any[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[5], Prepend<(any[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[4], Prepend<(any[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[3], Prepend<(any[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[2], Prepend<(any[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[1], Prepend<(any[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[0], T2>>>>>>>>>>; }[10 extends ({ 0: any[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: Prepend<({ 0: any[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[8], Prepend<({ 0: any[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[7], Prepend<({ 0: any[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[6], Prepend<({ 0: any[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[5], Prepend<({ 0: any[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[4], Prepend<({ 0: any[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[3], Prepend<({ 0: any[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[2], Prepend<({ 0: any[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[1], Prepend<({ 0: any[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[0], T2>>>>>>>>>; }[9 extends ({ 0: { 0: any[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: Prepend<({ 0: { 0: any[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[7], Prepend<({ 0: { 0: any[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[6], Prepend<({ 0: { 0: any[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[5], Prepend<({ 0: { 0: any[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[4], Prepend<({ 0: { 0: any[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[3], Prepend<({ 0: { 0: any[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[2], Prepend<({ 0: { 0: any[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[1], Prepend<({ 0: { 0: any[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[0], T2>>>>>>>>; }[8 extends ({ 0: { 0: { 0: any[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: Prepend<({ 0: { 0: { 0: any[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[6], Prepend<({ 0: { 0: { 0: any[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[5], Prepend<({ 0: { 0: { 0: any[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[4], Prepend<({ 0: { 0: { 0: any[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[3], Prepend<({ 0: { 0: { 0: any[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[2], Prepend<({ 0: { 0: { 0: any[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[1], Prepend<({ 0: { 0: { 0: any[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[0], T2>>>>>>>; }[7 extends ({ 0: { 0: { 0: { 0: any[4 extends T1["length"] ? 1 : 0]; 1: [head: T1[2], head: T1[1], head: T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: Prepend<({ 0: { 0: { 0: { 0: any[4 extends T1["length"] ? 1 : 0]; 1: [head: T1[2], head: T1[1], head: T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[5], Prepend<({ 0: { 0: { 0: { 0: any[4 extends T1["length"] ? 1 : 0]; 1: [head: T1[2], head: T1[1], head: T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[4], Prepend<({ 0: { 0: { 0: { 0: any[4 extends T1["length"] ? 1 : 0]; 1: [head: T1[2], head: T1[1], head: T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[3], Prepend<({ 0: { 0: { 0: { 0: any[4 extends T1["length"] ? 1 : 0]; 1: [head: T1[2], head: T1[1], head: T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[2], Prepend<({ 0: { 0: { 0: { 0: any[4 extends T1["length"] ? 1 : 0]; 1: [head: T1[2], head: T1[1], head: T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[1], Prepend<({ 0: { 0: { 0: { 0: any[4 extends T1["length"] ? 1 : 0]; 1: [head: T1[2], head: T1[1], head: T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[0], T2>>>>>>; }[6 extends ({ 0: { 0: { 0: { 0: { 0: any[5 extends T1["length"] ? 1 : 0]; 1: [head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [head: T1[2], head: T1[1], head: T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: Prepend<({ 0: { 0: { 0: { 0: { 0: any[5 extends T1["length"] ? 1 : 0]; 1: [head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [head: T1[2], head: T1[1], head: T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[4], Prepend<({ 0: { 0: { 0: { 0: { 0: any[5 extends T1["length"] ? 1 : 0]; 1: [head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [head: T1[2], head: T1[1], head: T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[3], Prepend<({ 0: { 0: { 0: { 0: { 0: any[5 extends T1["length"] ? 1 : 0]; 1: [head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [head: T1[2], head: T1[1], head: T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[2], Prepend<({ 0: { 0: { 0: { 0: { 0: any[5 extends T1["length"] ? 1 : 0]; 1: [head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [head: T1[2], head: T1[1], head: T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[1], Prepend<({ 0: { 0: { 0: { 0: { 0: any[5 extends T1["length"] ? 1 : 0]; 1: [head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [head: T1[2], head: T1[1], head: T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[0], T2>>>>>; }[5 extends ({ 0: { 0: { 0: { 0: { 0: { 0: any[6 extends T1["length"] ? 1 : 0]; 1: [head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[5 extends T1["length"] ? 1 : 0]; 1: [head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [head: T1[2], head: T1[1], head: T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: Prepend<({ 0: { 0: { 0: { 0: { 0: { 0: any[6 extends T1["length"] ? 1 : 0]; 1: [head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[5 extends T1["length"] ? 1 : 0]; 1: [head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [head: T1[2], head: T1[1], head: T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[3], Prepend<({ 0: { 0: { 0: { 0: { 0: { 0: any[6 extends T1["length"] ? 1 : 0]; 1: [head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[5 extends T1["length"] ? 1 : 0]; 1: [head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [head: T1[2], head: T1[1], head: T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[2], Prepend<({ 0: { 0: { 0: { 0: { 0: { 0: any[6 extends T1["length"] ? 1 : 0]; 1: [head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[5 extends T1["length"] ? 1 : 0]; 1: [head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [head: T1[2], head: T1[1], head: T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[1], Prepend<({ 0: { 0: { 0: { 0: { 0: { 0: any[6 extends T1["length"] ? 1 : 0]; 1: [head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[5 extends T1["length"] ? 1 : 0]; 1: [head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [head: T1[2], head: T1[1], head: T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[0], T2>>>>; }[4 extends ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: any[7 extends T1["length"] ? 1 : 0]; 1: [head: T1[5], head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[6 extends T1["length"] ? 1 : 0]; 1: [head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[5 extends T1["length"] ? 1 : 0]; 1: [head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [head: T1[2], head: T1[1], head: T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: Prepend<({ 0: { 0: { 0: { 0: { 0: { 0: { 0: any[7 extends T1["length"] ? 1 : 0]; 1: [head: T1[5], head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[6 extends T1["length"] ? 1 : 0]; 1: [head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[5 extends T1["length"] ? 1 : 0]; 1: [head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [head: T1[2], head: T1[1], head: T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[2], Prepend<({ 0: { 0: { 0: { 0: { 0: { 0: { 0: any[7 extends T1["length"] ? 1 : 0]; 1: [head: T1[5], head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[6 extends T1["length"] ? 1 : 0]; 1: [head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[5 extends T1["length"] ? 1 : 0]; 1: [head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [head: T1[2], head: T1[1], head: T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[1], Prepend<({ 0: { 0: { 0: { 0: { 0: { 0: { 0: any[7 extends T1["length"] ? 1 : 0]; 1: [head: T1[5], head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[6 extends T1["length"] ? 1 : 0]; 1: [head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[5 extends T1["length"] ? 1 : 0]; 1: [head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [head: T1[2], head: T1[1], head: T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[0], T2>>>; }[3 extends ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[8 extends T1["length"] ? 1 : 0]; 1: [head: T1[6], head: T1[5], head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[7 extends T1["length"] ? 1 : 0]; 1: [head: T1[5], head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[6 extends T1["length"] ? 1 : 0]; 1: [head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[5 extends T1["length"] ? 1 : 0]; 1: [head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [head: T1[2], head: T1[1], head: T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: Prepend<({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[8 extends T1["length"] ? 1 : 0]; 1: [head: T1[6], head: T1[5], head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[7 extends T1["length"] ? 1 : 0]; 1: [head: T1[5], head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[6 extends T1["length"] ? 1 : 0]; 1: [head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[5 extends T1["length"] ? 1 : 0]; 1: [head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [head: T1[2], head: T1[1], head: T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[1], Prepend<({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[8 extends T1["length"] ? 1 : 0]; 1: [head: T1[6], head: T1[5], head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[7 extends T1["length"] ? 1 : 0]; 1: [head: T1[5], head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[6 extends T1["length"] ? 1 : 0]; 1: [head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[5 extends T1["length"] ? 1 : 0]; 1: [head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [head: T1[2], head: T1[1], head: T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[0], T2>>; }[2 extends ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[9 extends T1["length"] ? 1 : 0]; 1: [head: T1[7], head: T1[6], head: T1[5], head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[8 extends T1["length"] ? 1 : 0]; 1: [head: T1[6], head: T1[5], head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[7 extends T1["length"] ? 1 : 0]; 1: [head: T1[5], head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[6 extends T1["length"] ? 1 : 0]; 1: [head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[5 extends T1["length"] ? 1 : 0]; 1: [head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [head: T1[2], head: T1[1], head: T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: Prepend<({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[9 extends T1["length"] ? 1 : 0]; 1: [head: T1[7], head: T1[6], head: T1[5], head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[8 extends T1["length"] ? 1 : 0]; 1: [head: T1[6], head: T1[5], head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[7 extends T1["length"] ? 1 : 0]; 1: [head: T1[5], head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[6 extends T1["length"] ? 1 : 0]; 1: [head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[5 extends T1["length"] ? 1 : 0]; 1: [head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [head: T1[2], head: T1[1], head: T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)[0], T2>; }[1 extends ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[10 extends T1["length"] ? 1 : 0]; 1: [head: T1[8], head: T1[7], head: T1[6], head: T1[5], head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[9 extends T1["length"] ? 1 : 0]; 1: [head: T1[7], head: T1[6], head: T1[5], head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[8 extends T1["length"] ? 1 : 0]; 1: [head: T1[6], head: T1[5], head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[7 extends T1["length"] ? 1 : 0]; 1: [head: T1[5], head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[6 extends T1["length"] ? 1 : 0]; 1: [head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[5 extends T1["length"] ? 1 : 0]; 1: [head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [head: T1[2], head: T1[1], head: T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: T2; }[0 extends ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[11 extends T1["length"] ? 1 : 0]; 1: [head: T1[9], head: T1[8], head: T1[7], head: T1[6], head: T1[5], head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[10 extends T1["length"] ? 1 : 0]; 1: [head: T1[8], head: T1[7], head: T1[6], head: T1[5], head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[9 extends T1["length"] ? 1 : 0]; 1: [head: T1[7], head: T1[6], head: T1[5], head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[8 extends T1["length"] ? 1 : 0]; 1: [head: T1[6], head: T1[5], head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[7 extends T1["length"] ? 1 : 0]; 1: [head: T1[5], head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[6 extends T1["length"] ? 1 : 0]; 1: [head: T1[4], head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[5 extends T1["length"] ? 1 : 0]; 1: [head: T1[3], head: T1[2], head: T1[1], head: T1[0]]; }[4 extends T1["length"] ? 1 : 0]; 1: [head: T1[2], head: T1[1], head: T1[0]]; }[3 extends T1["length"] ? 1 : 0]; 1: [head: T1[1], head: T1[0]]; }[2 extends T1["length"] ? 1 : 0]; 1: [head: T1[0]]; }[1 extends T1["length"] ? 1 : 0]; 1: []; }[0 extends T1["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0] Reverse extends infer R ? Cast : never, T2>; type Append = ->Append : { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[11 extends (any[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: [(any[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[9], (any[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[8], (any[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[7], (any[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[6], (any[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[5], (any[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[4], (any[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[3], (any[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[2], (any[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[1], (any[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[0], E]; }[10 extends ({ 0: any[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: [({ 0: any[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[8], ({ 0: any[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[7], ({ 0: any[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[6], ({ 0: any[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[5], ({ 0: any[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[4], ({ 0: any[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[3], ({ 0: any[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[2], ({ 0: any[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[1], ({ 0: any[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[0], E]; }[9 extends ({ 0: { 0: any[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: [({ 0: { 0: any[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[7], ({ 0: { 0: any[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[6], ({ 0: { 0: any[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[5], ({ 0: { 0: any[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[4], ({ 0: { 0: any[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[3], ({ 0: { 0: any[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[2], ({ 0: { 0: any[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[1], ({ 0: { 0: any[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[0], E]; }[8 extends ({ 0: { 0: { 0: any[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: [({ 0: { 0: { 0: any[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[6], ({ 0: { 0: { 0: any[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[5], ({ 0: { 0: { 0: any[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[4], ({ 0: { 0: { 0: any[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[3], ({ 0: { 0: { 0: any[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[2], ({ 0: { 0: { 0: any[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[1], ({ 0: { 0: { 0: any[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[0], E]; }[7 extends ({ 0: { 0: { 0: { 0: any[4 extends T["length"] ? 1 : 0]; 1: [T[2], T[1], T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: [({ 0: { 0: { 0: { 0: any[4 extends T["length"] ? 1 : 0]; 1: [T[2], T[1], T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[5], ({ 0: { 0: { 0: { 0: any[4 extends T["length"] ? 1 : 0]; 1: [T[2], T[1], T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[4], ({ 0: { 0: { 0: { 0: any[4 extends T["length"] ? 1 : 0]; 1: [T[2], T[1], T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[3], ({ 0: { 0: { 0: { 0: any[4 extends T["length"] ? 1 : 0]; 1: [T[2], T[1], T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[2], ({ 0: { 0: { 0: { 0: any[4 extends T["length"] ? 1 : 0]; 1: [T[2], T[1], T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[1], ({ 0: { 0: { 0: { 0: any[4 extends T["length"] ? 1 : 0]; 1: [T[2], T[1], T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[0], E]; }[6 extends ({ 0: { 0: { 0: { 0: { 0: any[5 extends T["length"] ? 1 : 0]; 1: [T[3], T[2], T[1], T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [T[2], T[1], T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: [({ 0: { 0: { 0: { 0: { 0: any[5 extends T["length"] ? 1 : 0]; 1: [T[3], T[2], T[1], T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [T[2], T[1], T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[4], ({ 0: { 0: { 0: { 0: { 0: any[5 extends T["length"] ? 1 : 0]; 1: [T[3], T[2], T[1], T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [T[2], T[1], T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[3], ({ 0: { 0: { 0: { 0: { 0: any[5 extends T["length"] ? 1 : 0]; 1: [T[3], T[2], T[1], T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [T[2], T[1], T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[2], ({ 0: { 0: { 0: { 0: { 0: any[5 extends T["length"] ? 1 : 0]; 1: [T[3], T[2], T[1], T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [T[2], T[1], T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[1], ({ 0: { 0: { 0: { 0: { 0: any[5 extends T["length"] ? 1 : 0]; 1: [T[3], T[2], T[1], T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [T[2], T[1], T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[0], E]; }[5 extends ({ 0: { 0: { 0: { 0: { 0: { 0: any[6 extends T["length"] ? 1 : 0]; 1: [T[4], T[3], T[2], T[1], T[0]]; }[5 extends T["length"] ? 1 : 0]; 1: [T[3], T[2], T[1], T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [T[2], T[1], T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: [({ 0: { 0: { 0: { 0: { 0: { 0: any[6 extends T["length"] ? 1 : 0]; 1: [T[4], T[3], T[2], T[1], T[0]]; }[5 extends T["length"] ? 1 : 0]; 1: [T[3], T[2], T[1], T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [T[2], T[1], T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[3], ({ 0: { 0: { 0: { 0: { 0: { 0: any[6 extends T["length"] ? 1 : 0]; 1: [T[4], T[3], T[2], T[1], T[0]]; }[5 extends T["length"] ? 1 : 0]; 1: [T[3], T[2], T[1], T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [T[2], T[1], T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[2], ({ 0: { 0: { 0: { 0: { 0: { 0: any[6 extends T["length"] ? 1 : 0]; 1: [T[4], T[3], T[2], T[1], T[0]]; }[5 extends T["length"] ? 1 : 0]; 1: [T[3], T[2], T[1], T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [T[2], T[1], T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[1], ({ 0: { 0: { 0: { 0: { 0: { 0: any[6 extends T["length"] ? 1 : 0]; 1: [T[4], T[3], T[2], T[1], T[0]]; }[5 extends T["length"] ? 1 : 0]; 1: [T[3], T[2], T[1], T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [T[2], T[1], T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[0], E]; }[4 extends ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: any[7 extends T["length"] ? 1 : 0]; 1: [T[5], T[4], T[3], T[2], T[1], T[0]]; }[6 extends T["length"] ? 1 : 0]; 1: [T[4], T[3], T[2], T[1], T[0]]; }[5 extends T["length"] ? 1 : 0]; 1: [T[3], T[2], T[1], T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [T[2], T[1], T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: [({ 0: { 0: { 0: { 0: { 0: { 0: { 0: any[7 extends T["length"] ? 1 : 0]; 1: [T[5], T[4], T[3], T[2], T[1], T[0]]; }[6 extends T["length"] ? 1 : 0]; 1: [T[4], T[3], T[2], T[1], T[0]]; }[5 extends T["length"] ? 1 : 0]; 1: [T[3], T[2], T[1], T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [T[2], T[1], T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[2], ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: any[7 extends T["length"] ? 1 : 0]; 1: [T[5], T[4], T[3], T[2], T[1], T[0]]; }[6 extends T["length"] ? 1 : 0]; 1: [T[4], T[3], T[2], T[1], T[0]]; }[5 extends T["length"] ? 1 : 0]; 1: [T[3], T[2], T[1], T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [T[2], T[1], T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[1], ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: any[7 extends T["length"] ? 1 : 0]; 1: [T[5], T[4], T[3], T[2], T[1], T[0]]; }[6 extends T["length"] ? 1 : 0]; 1: [T[4], T[3], T[2], T[1], T[0]]; }[5 extends T["length"] ? 1 : 0]; 1: [T[3], T[2], T[1], T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [T[2], T[1], T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[0], E]; }[3 extends ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[8 extends T["length"] ? 1 : 0]; 1: [T[6], T[5], T[4], T[3], T[2], T[1], T[0]]; }[7 extends T["length"] ? 1 : 0]; 1: [T[5], T[4], T[3], T[2], T[1], T[0]]; }[6 extends T["length"] ? 1 : 0]; 1: [T[4], T[3], T[2], T[1], T[0]]; }[5 extends T["length"] ? 1 : 0]; 1: [T[3], T[2], T[1], T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [T[2], T[1], T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: [({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[8 extends T["length"] ? 1 : 0]; 1: [T[6], T[5], T[4], T[3], T[2], T[1], T[0]]; }[7 extends T["length"] ? 1 : 0]; 1: [T[5], T[4], T[3], T[2], T[1], T[0]]; }[6 extends T["length"] ? 1 : 0]; 1: [T[4], T[3], T[2], T[1], T[0]]; }[5 extends T["length"] ? 1 : 0]; 1: [T[3], T[2], T[1], T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [T[2], T[1], T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[1], ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[8 extends T["length"] ? 1 : 0]; 1: [T[6], T[5], T[4], T[3], T[2], T[1], T[0]]; }[7 extends T["length"] ? 1 : 0]; 1: [T[5], T[4], T[3], T[2], T[1], T[0]]; }[6 extends T["length"] ? 1 : 0]; 1: [T[4], T[3], T[2], T[1], T[0]]; }[5 extends T["length"] ? 1 : 0]; 1: [T[3], T[2], T[1], T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [T[2], T[1], T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[0], E]; }[2 extends ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[9 extends T["length"] ? 1 : 0]; 1: [T[7], T[6], T[5], T[4], T[3], T[2], T[1], T[0]]; }[8 extends T["length"] ? 1 : 0]; 1: [T[6], T[5], T[4], T[3], T[2], T[1], T[0]]; }[7 extends T["length"] ? 1 : 0]; 1: [T[5], T[4], T[3], T[2], T[1], T[0]]; }[6 extends T["length"] ? 1 : 0]; 1: [T[4], T[3], T[2], T[1], T[0]]; }[5 extends T["length"] ? 1 : 0]; 1: [T[3], T[2], T[1], T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [T[2], T[1], T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: [({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[9 extends T["length"] ? 1 : 0]; 1: [T[7], T[6], T[5], T[4], T[3], T[2], T[1], T[0]]; }[8 extends T["length"] ? 1 : 0]; 1: [T[6], T[5], T[4], T[3], T[2], T[1], T[0]]; }[7 extends T["length"] ? 1 : 0]; 1: [T[5], T[4], T[3], T[2], T[1], T[0]]; }[6 extends T["length"] ? 1 : 0]; 1: [T[4], T[3], T[2], T[1], T[0]]; }[5 extends T["length"] ? 1 : 0]; 1: [T[3], T[2], T[1], T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [T[2], T[1], T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[0], E]; }[1 extends ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[10 extends T["length"] ? 1 : 0]; 1: [T[8], T[7], T[6], T[5], T[4], T[3], T[2], T[1], T[0]]; }[9 extends T["length"] ? 1 : 0]; 1: [T[7], T[6], T[5], T[4], T[3], T[2], T[1], T[0]]; }[8 extends T["length"] ? 1 : 0]; 1: [T[6], T[5], T[4], T[3], T[2], T[1], T[0]]; }[7 extends T["length"] ? 1 : 0]; 1: [T[5], T[4], T[3], T[2], T[1], T[0]]; }[6 extends T["length"] ? 1 : 0]; 1: [T[4], T[3], T[2], T[1], T[0]]; }[5 extends T["length"] ? 1 : 0]; 1: [T[3], T[2], T[1], T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [T[2], T[1], T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: [E]; }[0 extends ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[11 extends T["length"] ? 1 : 0]; 1: [T[9], T[8], T[7], T[6], T[5], T[4], T[3], T[2], T[1], T[0]]; }[10 extends T["length"] ? 1 : 0]; 1: [T[8], T[7], T[6], T[5], T[4], T[3], T[2], T[1], T[0]]; }[9 extends T["length"] ? 1 : 0]; 1: [T[7], T[6], T[5], T[4], T[3], T[2], T[1], T[0]]; }[8 extends T["length"] ? 1 : 0]; 1: [T[6], T[5], T[4], T[3], T[2], T[1], T[0]]; }[7 extends T["length"] ? 1 : 0]; 1: [T[5], T[4], T[3], T[2], T[1], T[0]]; }[6 extends T["length"] ? 1 : 0]; 1: [T[4], T[3], T[2], T[1], T[0]]; }[5 extends T["length"] ? 1 : 0]; 1: [T[3], T[2], T[1], T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [T[2], T[1], T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [T[1], T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0] +>Append : { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[11 extends (any[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: [head: (any[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[9], head: (any[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[8], head: (any[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[7], head: (any[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[6], head: (any[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[5], head: (any[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[4], head: (any[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[3], head: (any[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[2], head: (any[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[1], head: (any[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[0], args_0: E]; }[10 extends ({ 0: any[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: [head: ({ 0: any[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[8], head: ({ 0: any[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[7], head: ({ 0: any[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[6], head: ({ 0: any[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[5], head: ({ 0: any[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[4], head: ({ 0: any[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[3], head: ({ 0: any[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[2], head: ({ 0: any[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[1], head: ({ 0: any[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[0], args_0: E]; }[9 extends ({ 0: { 0: any[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: [head: ({ 0: { 0: any[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[7], head: ({ 0: { 0: any[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[6], head: ({ 0: { 0: any[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[5], head: ({ 0: { 0: any[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[4], head: ({ 0: { 0: any[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[3], head: ({ 0: { 0: any[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[2], head: ({ 0: { 0: any[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[1], head: ({ 0: { 0: any[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[0], args_0: E]; }[8 extends ({ 0: { 0: { 0: any[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: [head: ({ 0: { 0: { 0: any[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[6], head: ({ 0: { 0: { 0: any[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[5], head: ({ 0: { 0: { 0: any[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[4], head: ({ 0: { 0: { 0: any[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[3], head: ({ 0: { 0: { 0: any[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[2], head: ({ 0: { 0: { 0: any[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[1], head: ({ 0: { 0: { 0: any[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[0], args_0: E]; }[7 extends ({ 0: { 0: { 0: { 0: any[4 extends T["length"] ? 1 : 0]; 1: [head: T[2], head: T[1], head: T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: [head: ({ 0: { 0: { 0: { 0: any[4 extends T["length"] ? 1 : 0]; 1: [head: T[2], head: T[1], head: T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[5], head: ({ 0: { 0: { 0: { 0: any[4 extends T["length"] ? 1 : 0]; 1: [head: T[2], head: T[1], head: T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[4], head: ({ 0: { 0: { 0: { 0: any[4 extends T["length"] ? 1 : 0]; 1: [head: T[2], head: T[1], head: T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[3], head: ({ 0: { 0: { 0: { 0: any[4 extends T["length"] ? 1 : 0]; 1: [head: T[2], head: T[1], head: T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[2], head: ({ 0: { 0: { 0: { 0: any[4 extends T["length"] ? 1 : 0]; 1: [head: T[2], head: T[1], head: T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[1], head: ({ 0: { 0: { 0: { 0: any[4 extends T["length"] ? 1 : 0]; 1: [head: T[2], head: T[1], head: T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[0], args_0: E]; }[6 extends ({ 0: { 0: { 0: { 0: { 0: any[5 extends T["length"] ? 1 : 0]; 1: [head: T[3], head: T[2], head: T[1], head: T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [head: T[2], head: T[1], head: T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: [head: ({ 0: { 0: { 0: { 0: { 0: any[5 extends T["length"] ? 1 : 0]; 1: [head: T[3], head: T[2], head: T[1], head: T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [head: T[2], head: T[1], head: T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[4], head: ({ 0: { 0: { 0: { 0: { 0: any[5 extends T["length"] ? 1 : 0]; 1: [head: T[3], head: T[2], head: T[1], head: T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [head: T[2], head: T[1], head: T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[3], head: ({ 0: { 0: { 0: { 0: { 0: any[5 extends T["length"] ? 1 : 0]; 1: [head: T[3], head: T[2], head: T[1], head: T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [head: T[2], head: T[1], head: T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[2], head: ({ 0: { 0: { 0: { 0: { 0: any[5 extends T["length"] ? 1 : 0]; 1: [head: T[3], head: T[2], head: T[1], head: T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [head: T[2], head: T[1], head: T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[1], head: ({ 0: { 0: { 0: { 0: { 0: any[5 extends T["length"] ? 1 : 0]; 1: [head: T[3], head: T[2], head: T[1], head: T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [head: T[2], head: T[1], head: T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[0], args_0: E]; }[5 extends ({ 0: { 0: { 0: { 0: { 0: { 0: any[6 extends T["length"] ? 1 : 0]; 1: [head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[5 extends T["length"] ? 1 : 0]; 1: [head: T[3], head: T[2], head: T[1], head: T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [head: T[2], head: T[1], head: T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: [head: ({ 0: { 0: { 0: { 0: { 0: { 0: any[6 extends T["length"] ? 1 : 0]; 1: [head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[5 extends T["length"] ? 1 : 0]; 1: [head: T[3], head: T[2], head: T[1], head: T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [head: T[2], head: T[1], head: T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[3], head: ({ 0: { 0: { 0: { 0: { 0: { 0: any[6 extends T["length"] ? 1 : 0]; 1: [head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[5 extends T["length"] ? 1 : 0]; 1: [head: T[3], head: T[2], head: T[1], head: T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [head: T[2], head: T[1], head: T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[2], head: ({ 0: { 0: { 0: { 0: { 0: { 0: any[6 extends T["length"] ? 1 : 0]; 1: [head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[5 extends T["length"] ? 1 : 0]; 1: [head: T[3], head: T[2], head: T[1], head: T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [head: T[2], head: T[1], head: T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[1], head: ({ 0: { 0: { 0: { 0: { 0: { 0: any[6 extends T["length"] ? 1 : 0]; 1: [head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[5 extends T["length"] ? 1 : 0]; 1: [head: T[3], head: T[2], head: T[1], head: T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [head: T[2], head: T[1], head: T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[0], args_0: E]; }[4 extends ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: any[7 extends T["length"] ? 1 : 0]; 1: [head: T[5], head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[6 extends T["length"] ? 1 : 0]; 1: [head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[5 extends T["length"] ? 1 : 0]; 1: [head: T[3], head: T[2], head: T[1], head: T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [head: T[2], head: T[1], head: T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: [head: ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: any[7 extends T["length"] ? 1 : 0]; 1: [head: T[5], head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[6 extends T["length"] ? 1 : 0]; 1: [head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[5 extends T["length"] ? 1 : 0]; 1: [head: T[3], head: T[2], head: T[1], head: T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [head: T[2], head: T[1], head: T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[2], head: ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: any[7 extends T["length"] ? 1 : 0]; 1: [head: T[5], head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[6 extends T["length"] ? 1 : 0]; 1: [head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[5 extends T["length"] ? 1 : 0]; 1: [head: T[3], head: T[2], head: T[1], head: T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [head: T[2], head: T[1], head: T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[1], head: ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: any[7 extends T["length"] ? 1 : 0]; 1: [head: T[5], head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[6 extends T["length"] ? 1 : 0]; 1: [head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[5 extends T["length"] ? 1 : 0]; 1: [head: T[3], head: T[2], head: T[1], head: T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [head: T[2], head: T[1], head: T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[0], args_0: E]; }[3 extends ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[8 extends T["length"] ? 1 : 0]; 1: [head: T[6], head: T[5], head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[7 extends T["length"] ? 1 : 0]; 1: [head: T[5], head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[6 extends T["length"] ? 1 : 0]; 1: [head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[5 extends T["length"] ? 1 : 0]; 1: [head: T[3], head: T[2], head: T[1], head: T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [head: T[2], head: T[1], head: T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: [head: ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[8 extends T["length"] ? 1 : 0]; 1: [head: T[6], head: T[5], head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[7 extends T["length"] ? 1 : 0]; 1: [head: T[5], head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[6 extends T["length"] ? 1 : 0]; 1: [head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[5 extends T["length"] ? 1 : 0]; 1: [head: T[3], head: T[2], head: T[1], head: T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [head: T[2], head: T[1], head: T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[1], head: ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[8 extends T["length"] ? 1 : 0]; 1: [head: T[6], head: T[5], head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[7 extends T["length"] ? 1 : 0]; 1: [head: T[5], head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[6 extends T["length"] ? 1 : 0]; 1: [head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[5 extends T["length"] ? 1 : 0]; 1: [head: T[3], head: T[2], head: T[1], head: T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [head: T[2], head: T[1], head: T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[0], args_0: E]; }[2 extends ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[9 extends T["length"] ? 1 : 0]; 1: [head: T[7], head: T[6], head: T[5], head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[8 extends T["length"] ? 1 : 0]; 1: [head: T[6], head: T[5], head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[7 extends T["length"] ? 1 : 0]; 1: [head: T[5], head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[6 extends T["length"] ? 1 : 0]; 1: [head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[5 extends T["length"] ? 1 : 0]; 1: [head: T[3], head: T[2], head: T[1], head: T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [head: T[2], head: T[1], head: T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: [head: ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[9 extends T["length"] ? 1 : 0]; 1: [head: T[7], head: T[6], head: T[5], head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[8 extends T["length"] ? 1 : 0]; 1: [head: T[6], head: T[5], head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[7 extends T["length"] ? 1 : 0]; 1: [head: T[5], head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[6 extends T["length"] ? 1 : 0]; 1: [head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[5 extends T["length"] ? 1 : 0]; 1: [head: T[3], head: T[2], head: T[1], head: T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [head: T[2], head: T[1], head: T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)[0], args_0: E]; }[1 extends ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[10 extends T["length"] ? 1 : 0]; 1: [head: T[8], head: T[7], head: T[6], head: T[5], head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[9 extends T["length"] ? 1 : 0]; 1: [head: T[7], head: T[6], head: T[5], head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[8 extends T["length"] ? 1 : 0]; 1: [head: T[6], head: T[5], head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[7 extends T["length"] ? 1 : 0]; 1: [head: T[5], head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[6 extends T["length"] ? 1 : 0]; 1: [head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[5 extends T["length"] ? 1 : 0]; 1: [head: T[3], head: T[2], head: T[1], head: T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [head: T[2], head: T[1], head: T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0]; 1: [E]; }[0 extends ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[11 extends T["length"] ? 1 : 0]; 1: [head: T[9], head: T[8], head: T[7], head: T[6], head: T[5], head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[10 extends T["length"] ? 1 : 0]; 1: [head: T[8], head: T[7], head: T[6], head: T[5], head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[9 extends T["length"] ? 1 : 0]; 1: [head: T[7], head: T[6], head: T[5], head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[8 extends T["length"] ? 1 : 0]; 1: [head: T[6], head: T[5], head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[7 extends T["length"] ? 1 : 0]; 1: [head: T[5], head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[6 extends T["length"] ? 1 : 0]; 1: [head: T[4], head: T[3], head: T[2], head: T[1], head: T[0]]; }[5 extends T["length"] ? 1 : 0]; 1: [head: T[3], head: T[2], head: T[1], head: T[0]]; }[4 extends T["length"] ? 1 : 0]; 1: [head: T[2], head: T[1], head: T[0]]; }[3 extends T["length"] ? 1 : 0]; 1: [head: T[1], head: T[0]]; }[2 extends T["length"] ? 1 : 0]; 1: [head: T[0]]; }[1 extends T["length"] ? 1 : 0]; 1: []; }[0 extends T["length"] ? 1 : 0] extends infer R ? Cast : never)["length"] ? 1 : 0] Concat; @@ -168,7 +168,7 @@ declare namespace Curry { >Tools : any 1: Tools.Concat, T2> extends infer D ? Tools.Cast : never>; ->1 : { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[11 extends (any[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)["length"] ? 1 : 0]; 1: [(any[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[9], (any[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[8], (any[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[7], (any[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[6], (any[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[5], (any[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[4], (any[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[3], (any[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[2], (any[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[1], (any[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[0], ...({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[11 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>>; }[10 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>; }[9 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>; }[8 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>; }[7 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>; }[6 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>; }[5 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>; }[4 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>; }[3 extends I["length"] ? 1 : 0]; 1: Tools.Tail>; }[2 extends I["length"] ? 1 : 0]; 1: Tools.Tail; }[1 extends I["length"] ? 1 : 0]; 1: T2; }[0 extends I["length"] ? 1 : 0] extends infer D ? Tools.Cast : never)[number][]]; }[10 extends ({ 0: any[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)["length"] ? 1 : 0]; 1: [({ 0: any[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[8], ({ 0: any[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[7], ({ 0: any[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[6], ({ 0: any[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[5], ({ 0: any[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[4], ({ 0: any[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[3], ({ 0: any[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[2], ({ 0: any[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[1], ({ 0: any[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[0], ...({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[11 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>>; }[10 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>; }[9 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>; }[8 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>; }[7 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>; }[6 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>; }[5 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>; }[4 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>; }[3 extends I["length"] ? 1 : 0]; 1: Tools.Tail>; }[2 extends I["length"] ? 1 : 0]; 1: Tools.Tail; }[1 extends I["length"] ? 1 : 0]; 1: T2; }[0 extends I["length"] ? 1 : 0] extends infer D ? Tools.Cast : never)[number][]]; }[9 extends ({ 0: { 0: any[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)["length"] ? 1 : 0]; 1: [({ 0: { 0: any[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[7], ({ 0: { 0: any[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[6], ({ 0: { 0: any[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[5], ({ 0: { 0: any[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[4], ({ 0: { 0: any[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[3], ({ 0: { 0: any[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[2], ({ 0: { 0: any[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[1], ({ 0: { 0: any[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[0], ...({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[11 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>>; }[10 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>; }[9 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>; }[8 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>; }[7 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>; }[6 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>; }[5 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>; }[4 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>; }[3 extends I["length"] ? 1 : 0]; 1: Tools.Tail>; }[2 extends I["length"] ? 1 : 0]; 1: Tools.Tail; }[1 extends I["length"] ? 1 : 0]; 1: T2; }[0 extends I["length"] ? 1 : 0] extends infer D ? Tools.Cast : never)[number][]]; }[8 extends ({ 0: { 0: { 0: any[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)["length"] ? 1 : 0]; 1: [({ 0: { 0: { 0: any[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[6], ({ 0: { 0: { 0: any[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[5], ({ 0: { 0: { 0: any[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[4], ({ 0: { 0: { 0: any[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[3], ({ 0: { 0: { 0: any[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[2], ({ 0: { 0: { 0: any[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[1], ({ 0: { 0: { 0: any[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[0], ...({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[11 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>>; }[10 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>; }[9 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>; }[8 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>; }[7 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>; }[6 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>; }[5 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>; }[4 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>; }[3 extends I["length"] ? 1 : 0]; 1: Tools.Tail>; }[2 extends I["length"] ? 1 : 0]; 1: Tools.Tail; }[1 extends I["length"] ? 1 : 0]; 1: T2; }[0 extends I["length"] ? 1 : 0] extends infer D ? Tools.Cast : never)[number][]]; }[7 extends ({ 0: { 0: { 0: { 0: any[4 extends TN["length"] ? 1 : 0]; 1: [TN[2], TN[1], TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)["length"] ? 1 : 0]; 1: [({ 0: { 0: { 0: { 0: any[4 extends TN["length"] ? 1 : 0]; 1: [TN[2], TN[1], TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[5], ({ 0: { 0: { 0: { 0: any[4 extends TN["length"] ? 1 : 0]; 1: [TN[2], TN[1], TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[4], ({ 0: { 0: { 0: { 0: any[4 extends TN["length"] ? 1 : 0]; 1: [TN[2], TN[1], TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[3], ({ 0: { 0: { 0: { 0: any[4 extends TN["length"] ? 1 : 0]; 1: [TN[2], TN[1], TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[2], ({ 0: { 0: { 0: { 0: any[4 extends TN["length"] ? 1 : 0]; 1: [TN[2], TN[1], TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[1], ({ 0: { 0: { 0: { 0: any[4 extends TN["length"] ? 1 : 0]; 1: [TN[2], TN[1], TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[0], ...({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[11 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>>; }[10 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>; }[9 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>; }[8 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>; }[7 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>; }[6 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>; }[5 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>; }[4 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>; }[3 extends I["length"] ? 1 : 0]; 1: Tools.Tail>; }[2 extends I["length"] ? 1 : 0]; 1: Tools.Tail; }[1 extends I["length"] ? 1 : 0]; 1: T2; }[0 extends I["length"] ? 1 : 0] extends infer D ? Tools.Cast : never)[number][]]; }[6 extends ({ 0: { 0: { 0: { 0: { 0: any[5 extends TN["length"] ? 1 : 0]; 1: [TN[3], TN[2], TN[1], TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [TN[2], TN[1], TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)["length"] ? 1 : 0]; 1: [({ 0: { 0: { 0: { 0: { 0: any[5 extends TN["length"] ? 1 : 0]; 1: [TN[3], TN[2], TN[1], TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [TN[2], TN[1], TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[4], ({ 0: { 0: { 0: { 0: { 0: any[5 extends TN["length"] ? 1 : 0]; 1: [TN[3], TN[2], TN[1], TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [TN[2], TN[1], TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[3], ({ 0: { 0: { 0: { 0: { 0: any[5 extends TN["length"] ? 1 : 0]; 1: [TN[3], TN[2], TN[1], TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [TN[2], TN[1], TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[2], ({ 0: { 0: { 0: { 0: { 0: any[5 extends TN["length"] ? 1 : 0]; 1: [TN[3], TN[2], TN[1], TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [TN[2], TN[1], TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[1], ({ 0: { 0: { 0: { 0: { 0: any[5 extends TN["length"] ? 1 : 0]; 1: [TN[3], TN[2], TN[1], TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [TN[2], TN[1], TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[0], ...({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[11 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>>; }[10 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>; }[9 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>; }[8 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>; }[7 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>; }[6 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>; }[5 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>; }[4 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>; }[3 extends I["length"] ? 1 : 0]; 1: Tools.Tail>; }[2 extends I["length"] ? 1 : 0]; 1: Tools.Tail; }[1 extends I["length"] ? 1 : 0]; 1: T2; }[0 extends I["length"] ? 1 : 0] extends infer D ? Tools.Cast : never)[number][]]; }[5 extends ({ 0: { 0: { 0: { 0: { 0: { 0: any[6 extends TN["length"] ? 1 : 0]; 1: [TN[4], TN[3], TN[2], TN[1], TN[0]]; }[5 extends TN["length"] ? 1 : 0]; 1: [TN[3], TN[2], TN[1], TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [TN[2], TN[1], TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)["length"] ? 1 : 0]; 1: [({ 0: { 0: { 0: { 0: { 0: { 0: any[6 extends TN["length"] ? 1 : 0]; 1: [TN[4], TN[3], TN[2], TN[1], TN[0]]; }[5 extends TN["length"] ? 1 : 0]; 1: [TN[3], TN[2], TN[1], TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [TN[2], TN[1], TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[3], ({ 0: { 0: { 0: { 0: { 0: { 0: any[6 extends TN["length"] ? 1 : 0]; 1: [TN[4], TN[3], TN[2], TN[1], TN[0]]; }[5 extends TN["length"] ? 1 : 0]; 1: [TN[3], TN[2], TN[1], TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [TN[2], TN[1], TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[2], ({ 0: { 0: { 0: { 0: { 0: { 0: any[6 extends TN["length"] ? 1 : 0]; 1: [TN[4], TN[3], TN[2], TN[1], TN[0]]; }[5 extends TN["length"] ? 1 : 0]; 1: [TN[3], TN[2], TN[1], TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [TN[2], TN[1], TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[1], ({ 0: { 0: { 0: { 0: { 0: { 0: any[6 extends TN["length"] ? 1 : 0]; 1: [TN[4], TN[3], TN[2], TN[1], TN[0]]; }[5 extends TN["length"] ? 1 : 0]; 1: [TN[3], TN[2], TN[1], TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [TN[2], TN[1], TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[0], ...({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[11 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>>; }[10 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>; }[9 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>; }[8 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>; }[7 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>; }[6 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>; }[5 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>; }[4 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>; }[3 extends I["length"] ? 1 : 0]; 1: Tools.Tail>; }[2 extends I["length"] ? 1 : 0]; 1: Tools.Tail; }[1 extends I["length"] ? 1 : 0]; 1: T2; }[0 extends I["length"] ? 1 : 0] extends infer D ? Tools.Cast : never)[number][]]; }[4 extends ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: any[7 extends TN["length"] ? 1 : 0]; 1: [TN[5], TN[4], TN[3], TN[2], TN[1], TN[0]]; }[6 extends TN["length"] ? 1 : 0]; 1: [TN[4], TN[3], TN[2], TN[1], TN[0]]; }[5 extends TN["length"] ? 1 : 0]; 1: [TN[3], TN[2], TN[1], TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [TN[2], TN[1], TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)["length"] ? 1 : 0]; 1: [({ 0: { 0: { 0: { 0: { 0: { 0: { 0: any[7 extends TN["length"] ? 1 : 0]; 1: [TN[5], TN[4], TN[3], TN[2], TN[1], TN[0]]; }[6 extends TN["length"] ? 1 : 0]; 1: [TN[4], TN[3], TN[2], TN[1], TN[0]]; }[5 extends TN["length"] ? 1 : 0]; 1: [TN[3], TN[2], TN[1], TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [TN[2], TN[1], TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[2], ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: any[7 extends TN["length"] ? 1 : 0]; 1: [TN[5], TN[4], TN[3], TN[2], TN[1], TN[0]]; }[6 extends TN["length"] ? 1 : 0]; 1: [TN[4], TN[3], TN[2], TN[1], TN[0]]; }[5 extends TN["length"] ? 1 : 0]; 1: [TN[3], TN[2], TN[1], TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [TN[2], TN[1], TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[1], ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: any[7 extends TN["length"] ? 1 : 0]; 1: [TN[5], TN[4], TN[3], TN[2], TN[1], TN[0]]; }[6 extends TN["length"] ? 1 : 0]; 1: [TN[4], TN[3], TN[2], TN[1], TN[0]]; }[5 extends TN["length"] ? 1 : 0]; 1: [TN[3], TN[2], TN[1], TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [TN[2], TN[1], TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[0], ...({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[11 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>>; }[10 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>; }[9 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>; }[8 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>; }[7 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>; }[6 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>; }[5 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>; }[4 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>; }[3 extends I["length"] ? 1 : 0]; 1: Tools.Tail>; }[2 extends I["length"] ? 1 : 0]; 1: Tools.Tail; }[1 extends I["length"] ? 1 : 0]; 1: T2; }[0 extends I["length"] ? 1 : 0] extends infer D ? Tools.Cast : never)[number][]]; }[3 extends ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[8 extends TN["length"] ? 1 : 0]; 1: [TN[6], TN[5], TN[4], TN[3], TN[2], TN[1], TN[0]]; }[7 extends TN["length"] ? 1 : 0]; 1: [TN[5], TN[4], TN[3], TN[2], TN[1], TN[0]]; }[6 extends TN["length"] ? 1 : 0]; 1: [TN[4], TN[3], TN[2], TN[1], TN[0]]; }[5 extends TN["length"] ? 1 : 0]; 1: [TN[3], TN[2], TN[1], TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [TN[2], TN[1], TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)["length"] ? 1 : 0]; 1: [({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[8 extends TN["length"] ? 1 : 0]; 1: [TN[6], TN[5], TN[4], TN[3], TN[2], TN[1], TN[0]]; }[7 extends TN["length"] ? 1 : 0]; 1: [TN[5], TN[4], TN[3], TN[2], TN[1], TN[0]]; }[6 extends TN["length"] ? 1 : 0]; 1: [TN[4], TN[3], TN[2], TN[1], TN[0]]; }[5 extends TN["length"] ? 1 : 0]; 1: [TN[3], TN[2], TN[1], TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [TN[2], TN[1], TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[1], ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[8 extends TN["length"] ? 1 : 0]; 1: [TN[6], TN[5], TN[4], TN[3], TN[2], TN[1], TN[0]]; }[7 extends TN["length"] ? 1 : 0]; 1: [TN[5], TN[4], TN[3], TN[2], TN[1], TN[0]]; }[6 extends TN["length"] ? 1 : 0]; 1: [TN[4], TN[3], TN[2], TN[1], TN[0]]; }[5 extends TN["length"] ? 1 : 0]; 1: [TN[3], TN[2], TN[1], TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [TN[2], TN[1], TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[0], ...({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[11 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>>; }[10 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>; }[9 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>; }[8 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>; }[7 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>; }[6 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>; }[5 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>; }[4 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>; }[3 extends I["length"] ? 1 : 0]; 1: Tools.Tail>; }[2 extends I["length"] ? 1 : 0]; 1: Tools.Tail; }[1 extends I["length"] ? 1 : 0]; 1: T2; }[0 extends I["length"] ? 1 : 0] extends infer D ? Tools.Cast : never)[number][]]; }[2 extends ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[9 extends TN["length"] ? 1 : 0]; 1: [TN[7], TN[6], TN[5], TN[4], TN[3], TN[2], TN[1], TN[0]]; }[8 extends TN["length"] ? 1 : 0]; 1: [TN[6], TN[5], TN[4], TN[3], TN[2], TN[1], TN[0]]; }[7 extends TN["length"] ? 1 : 0]; 1: [TN[5], TN[4], TN[3], TN[2], TN[1], TN[0]]; }[6 extends TN["length"] ? 1 : 0]; 1: [TN[4], TN[3], TN[2], TN[1], TN[0]]; }[5 extends TN["length"] ? 1 : 0]; 1: [TN[3], TN[2], TN[1], TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [TN[2], TN[1], TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)["length"] ? 1 : 0]; 1: [({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[9 extends TN["length"] ? 1 : 0]; 1: [TN[7], TN[6], TN[5], TN[4], TN[3], TN[2], TN[1], TN[0]]; }[8 extends TN["length"] ? 1 : 0]; 1: [TN[6], TN[5], TN[4], TN[3], TN[2], TN[1], TN[0]]; }[7 extends TN["length"] ? 1 : 0]; 1: [TN[5], TN[4], TN[3], TN[2], TN[1], TN[0]]; }[6 extends TN["length"] ? 1 : 0]; 1: [TN[4], TN[3], TN[2], TN[1], TN[0]]; }[5 extends TN["length"] ? 1 : 0]; 1: [TN[3], TN[2], TN[1], TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [TN[2], TN[1], TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[0], ...({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[11 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>>; }[10 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>; }[9 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>; }[8 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>; }[7 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>; }[6 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>; }[5 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>; }[4 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>; }[3 extends I["length"] ? 1 : 0]; 1: Tools.Tail>; }[2 extends I["length"] ? 1 : 0]; 1: Tools.Tail; }[1 extends I["length"] ? 1 : 0]; 1: T2; }[0 extends I["length"] ? 1 : 0] extends infer D ? Tools.Cast : never)[number][]]; }[1 extends ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[10 extends TN["length"] ? 1 : 0]; 1: [TN[8], TN[7], TN[6], TN[5], TN[4], TN[3], TN[2], TN[1], TN[0]]; }[9 extends TN["length"] ? 1 : 0]; 1: [TN[7], TN[6], TN[5], TN[4], TN[3], TN[2], TN[1], TN[0]]; }[8 extends TN["length"] ? 1 : 0]; 1: [TN[6], TN[5], TN[4], TN[3], TN[2], TN[1], TN[0]]; }[7 extends TN["length"] ? 1 : 0]; 1: [TN[5], TN[4], TN[3], TN[2], TN[1], TN[0]]; }[6 extends TN["length"] ? 1 : 0]; 1: [TN[4], TN[3], TN[2], TN[1], TN[0]]; }[5 extends TN["length"] ? 1 : 0]; 1: [TN[3], TN[2], TN[1], TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [TN[2], TN[1], TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)["length"] ? 1 : 0]; 1: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[11 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>>; }[10 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>; }[9 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>; }[8 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>; }[7 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>; }[6 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>; }[5 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>; }[4 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>; }[3 extends I["length"] ? 1 : 0]; 1: Tools.Tail>; }[2 extends I["length"] ? 1 : 0]; 1: Tools.Tail; }[1 extends I["length"] ? 1 : 0]; 1: T2; }[0 extends I["length"] ? 1 : 0] extends infer D ? Tools.Cast : never; }[0 extends ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[11 extends TN["length"] ? 1 : 0]; 1: [TN[9], TN[8], TN[7], TN[6], TN[5], TN[4], TN[3], TN[2], TN[1], TN[0]]; }[10 extends TN["length"] ? 1 : 0]; 1: [TN[8], TN[7], TN[6], TN[5], TN[4], TN[3], TN[2], TN[1], TN[0]]; }[9 extends TN["length"] ? 1 : 0]; 1: [TN[7], TN[6], TN[5], TN[4], TN[3], TN[2], TN[1], TN[0]]; }[8 extends TN["length"] ? 1 : 0]; 1: [TN[6], TN[5], TN[4], TN[3], TN[2], TN[1], TN[0]]; }[7 extends TN["length"] ? 1 : 0]; 1: [TN[5], TN[4], TN[3], TN[2], TN[1], TN[0]]; }[6 extends TN["length"] ? 1 : 0]; 1: [TN[4], TN[3], TN[2], TN[1], TN[0]]; }[5 extends TN["length"] ? 1 : 0]; 1: [TN[3], TN[2], TN[1], TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [TN[2], TN[1], TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [TN[1], TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)["length"] ? 1 : 0] +>1 : { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[11 extends (any[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)["length"] ? 1 : 0]; 1: [head: (any[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[9], head: (any[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[8], head: (any[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[7], head: (any[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[6], head: (any[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[5], head: (any[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[4], head: (any[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[3], head: (any[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[2], head: (any[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[1], head: (any[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[0], args: ...({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[11 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>>; }[10 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>; }[9 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>; }[8 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>; }[7 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>; }[6 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>; }[5 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>; }[4 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>; }[3 extends I["length"] ? 1 : 0]; 1: Tools.Tail>; }[2 extends I["length"] ? 1 : 0]; 1: Tools.Tail; }[1 extends I["length"] ? 1 : 0]; 1: T2; }[0 extends I["length"] ? 1 : 0] extends infer D ? Tools.Cast : never)[number][]]; }[10 extends ({ 0: any[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)["length"] ? 1 : 0]; 1: [head: ({ 0: any[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[8], head: ({ 0: any[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[7], head: ({ 0: any[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[6], head: ({ 0: any[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[5], head: ({ 0: any[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[4], head: ({ 0: any[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[3], head: ({ 0: any[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[2], head: ({ 0: any[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[1], head: ({ 0: any[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[0], args: ...({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[11 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>>; }[10 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>; }[9 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>; }[8 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>; }[7 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>; }[6 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>; }[5 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>; }[4 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>; }[3 extends I["length"] ? 1 : 0]; 1: Tools.Tail>; }[2 extends I["length"] ? 1 : 0]; 1: Tools.Tail; }[1 extends I["length"] ? 1 : 0]; 1: T2; }[0 extends I["length"] ? 1 : 0] extends infer D ? Tools.Cast : never)[number][]]; }[9 extends ({ 0: { 0: any[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)["length"] ? 1 : 0]; 1: [head: ({ 0: { 0: any[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[7], head: ({ 0: { 0: any[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[6], head: ({ 0: { 0: any[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[5], head: ({ 0: { 0: any[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[4], head: ({ 0: { 0: any[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[3], head: ({ 0: { 0: any[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[2], head: ({ 0: { 0: any[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[1], head: ({ 0: { 0: any[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[0], args: ...({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[11 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>>; }[10 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>; }[9 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>; }[8 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>; }[7 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>; }[6 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>; }[5 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>; }[4 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>; }[3 extends I["length"] ? 1 : 0]; 1: Tools.Tail>; }[2 extends I["length"] ? 1 : 0]; 1: Tools.Tail; }[1 extends I["length"] ? 1 : 0]; 1: T2; }[0 extends I["length"] ? 1 : 0] extends infer D ? Tools.Cast : never)[number][]]; }[8 extends ({ 0: { 0: { 0: any[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)["length"] ? 1 : 0]; 1: [head: ({ 0: { 0: { 0: any[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[6], head: ({ 0: { 0: { 0: any[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[5], head: ({ 0: { 0: { 0: any[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[4], head: ({ 0: { 0: { 0: any[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[3], head: ({ 0: { 0: { 0: any[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[2], head: ({ 0: { 0: { 0: any[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[1], head: ({ 0: { 0: { 0: any[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[0], args: ...({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[11 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>>; }[10 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>; }[9 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>; }[8 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>; }[7 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>; }[6 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>; }[5 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>; }[4 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>; }[3 extends I["length"] ? 1 : 0]; 1: Tools.Tail>; }[2 extends I["length"] ? 1 : 0]; 1: Tools.Tail; }[1 extends I["length"] ? 1 : 0]; 1: T2; }[0 extends I["length"] ? 1 : 0] extends infer D ? Tools.Cast : never)[number][]]; }[7 extends ({ 0: { 0: { 0: { 0: any[4 extends TN["length"] ? 1 : 0]; 1: [head: TN[2], head: TN[1], head: TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)["length"] ? 1 : 0]; 1: [head: ({ 0: { 0: { 0: { 0: any[4 extends TN["length"] ? 1 : 0]; 1: [head: TN[2], head: TN[1], head: TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[5], head: ({ 0: { 0: { 0: { 0: any[4 extends TN["length"] ? 1 : 0]; 1: [head: TN[2], head: TN[1], head: TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[4], head: ({ 0: { 0: { 0: { 0: any[4 extends TN["length"] ? 1 : 0]; 1: [head: TN[2], head: TN[1], head: TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[3], head: ({ 0: { 0: { 0: { 0: any[4 extends TN["length"] ? 1 : 0]; 1: [head: TN[2], head: TN[1], head: TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[2], head: ({ 0: { 0: { 0: { 0: any[4 extends TN["length"] ? 1 : 0]; 1: [head: TN[2], head: TN[1], head: TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[1], head: ({ 0: { 0: { 0: { 0: any[4 extends TN["length"] ? 1 : 0]; 1: [head: TN[2], head: TN[1], head: TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[0], args: ...({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[11 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>>; }[10 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>; }[9 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>; }[8 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>; }[7 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>; }[6 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>; }[5 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>; }[4 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>; }[3 extends I["length"] ? 1 : 0]; 1: Tools.Tail>; }[2 extends I["length"] ? 1 : 0]; 1: Tools.Tail; }[1 extends I["length"] ? 1 : 0]; 1: T2; }[0 extends I["length"] ? 1 : 0] extends infer D ? Tools.Cast : never)[number][]]; }[6 extends ({ 0: { 0: { 0: { 0: { 0: any[5 extends TN["length"] ? 1 : 0]; 1: [head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [head: TN[2], head: TN[1], head: TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)["length"] ? 1 : 0]; 1: [head: ({ 0: { 0: { 0: { 0: { 0: any[5 extends TN["length"] ? 1 : 0]; 1: [head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [head: TN[2], head: TN[1], head: TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[4], head: ({ 0: { 0: { 0: { 0: { 0: any[5 extends TN["length"] ? 1 : 0]; 1: [head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [head: TN[2], head: TN[1], head: TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[3], head: ({ 0: { 0: { 0: { 0: { 0: any[5 extends TN["length"] ? 1 : 0]; 1: [head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [head: TN[2], head: TN[1], head: TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[2], head: ({ 0: { 0: { 0: { 0: { 0: any[5 extends TN["length"] ? 1 : 0]; 1: [head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [head: TN[2], head: TN[1], head: TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[1], head: ({ 0: { 0: { 0: { 0: { 0: any[5 extends TN["length"] ? 1 : 0]; 1: [head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [head: TN[2], head: TN[1], head: TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[0], args: ...({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[11 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>>; }[10 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>; }[9 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>; }[8 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>; }[7 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>; }[6 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>; }[5 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>; }[4 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>; }[3 extends I["length"] ? 1 : 0]; 1: Tools.Tail>; }[2 extends I["length"] ? 1 : 0]; 1: Tools.Tail; }[1 extends I["length"] ? 1 : 0]; 1: T2; }[0 extends I["length"] ? 1 : 0] extends infer D ? Tools.Cast : never)[number][]]; }[5 extends ({ 0: { 0: { 0: { 0: { 0: { 0: any[6 extends TN["length"] ? 1 : 0]; 1: [head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[5 extends TN["length"] ? 1 : 0]; 1: [head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [head: TN[2], head: TN[1], head: TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)["length"] ? 1 : 0]; 1: [head: ({ 0: { 0: { 0: { 0: { 0: { 0: any[6 extends TN["length"] ? 1 : 0]; 1: [head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[5 extends TN["length"] ? 1 : 0]; 1: [head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [head: TN[2], head: TN[1], head: TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[3], head: ({ 0: { 0: { 0: { 0: { 0: { 0: any[6 extends TN["length"] ? 1 : 0]; 1: [head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[5 extends TN["length"] ? 1 : 0]; 1: [head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [head: TN[2], head: TN[1], head: TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[2], head: ({ 0: { 0: { 0: { 0: { 0: { 0: any[6 extends TN["length"] ? 1 : 0]; 1: [head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[5 extends TN["length"] ? 1 : 0]; 1: [head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [head: TN[2], head: TN[1], head: TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[1], head: ({ 0: { 0: { 0: { 0: { 0: { 0: any[6 extends TN["length"] ? 1 : 0]; 1: [head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[5 extends TN["length"] ? 1 : 0]; 1: [head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [head: TN[2], head: TN[1], head: TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[0], args: ...({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[11 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>>; }[10 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>; }[9 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>; }[8 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>; }[7 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>; }[6 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>; }[5 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>; }[4 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>; }[3 extends I["length"] ? 1 : 0]; 1: Tools.Tail>; }[2 extends I["length"] ? 1 : 0]; 1: Tools.Tail; }[1 extends I["length"] ? 1 : 0]; 1: T2; }[0 extends I["length"] ? 1 : 0] extends infer D ? Tools.Cast : never)[number][]]; }[4 extends ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: any[7 extends TN["length"] ? 1 : 0]; 1: [head: TN[5], head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[6 extends TN["length"] ? 1 : 0]; 1: [head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[5 extends TN["length"] ? 1 : 0]; 1: [head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [head: TN[2], head: TN[1], head: TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)["length"] ? 1 : 0]; 1: [head: ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: any[7 extends TN["length"] ? 1 : 0]; 1: [head: TN[5], head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[6 extends TN["length"] ? 1 : 0]; 1: [head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[5 extends TN["length"] ? 1 : 0]; 1: [head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [head: TN[2], head: TN[1], head: TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[2], head: ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: any[7 extends TN["length"] ? 1 : 0]; 1: [head: TN[5], head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[6 extends TN["length"] ? 1 : 0]; 1: [head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[5 extends TN["length"] ? 1 : 0]; 1: [head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [head: TN[2], head: TN[1], head: TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[1], head: ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: any[7 extends TN["length"] ? 1 : 0]; 1: [head: TN[5], head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[6 extends TN["length"] ? 1 : 0]; 1: [head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[5 extends TN["length"] ? 1 : 0]; 1: [head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [head: TN[2], head: TN[1], head: TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[0], args: ...({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[11 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>>; }[10 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>; }[9 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>; }[8 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>; }[7 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>; }[6 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>; }[5 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>; }[4 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>; }[3 extends I["length"] ? 1 : 0]; 1: Tools.Tail>; }[2 extends I["length"] ? 1 : 0]; 1: Tools.Tail; }[1 extends I["length"] ? 1 : 0]; 1: T2; }[0 extends I["length"] ? 1 : 0] extends infer D ? Tools.Cast : never)[number][]]; }[3 extends ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[8 extends TN["length"] ? 1 : 0]; 1: [head: TN[6], head: TN[5], head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[7 extends TN["length"] ? 1 : 0]; 1: [head: TN[5], head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[6 extends TN["length"] ? 1 : 0]; 1: [head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[5 extends TN["length"] ? 1 : 0]; 1: [head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [head: TN[2], head: TN[1], head: TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)["length"] ? 1 : 0]; 1: [head: ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[8 extends TN["length"] ? 1 : 0]; 1: [head: TN[6], head: TN[5], head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[7 extends TN["length"] ? 1 : 0]; 1: [head: TN[5], head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[6 extends TN["length"] ? 1 : 0]; 1: [head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[5 extends TN["length"] ? 1 : 0]; 1: [head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [head: TN[2], head: TN[1], head: TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[1], head: ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[8 extends TN["length"] ? 1 : 0]; 1: [head: TN[6], head: TN[5], head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[7 extends TN["length"] ? 1 : 0]; 1: [head: TN[5], head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[6 extends TN["length"] ? 1 : 0]; 1: [head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[5 extends TN["length"] ? 1 : 0]; 1: [head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [head: TN[2], head: TN[1], head: TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[0], args: ...({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[11 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>>; }[10 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>; }[9 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>; }[8 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>; }[7 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>; }[6 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>; }[5 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>; }[4 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>; }[3 extends I["length"] ? 1 : 0]; 1: Tools.Tail>; }[2 extends I["length"] ? 1 : 0]; 1: Tools.Tail; }[1 extends I["length"] ? 1 : 0]; 1: T2; }[0 extends I["length"] ? 1 : 0] extends infer D ? Tools.Cast : never)[number][]]; }[2 extends ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[9 extends TN["length"] ? 1 : 0]; 1: [head: TN[7], head: TN[6], head: TN[5], head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[8 extends TN["length"] ? 1 : 0]; 1: [head: TN[6], head: TN[5], head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[7 extends TN["length"] ? 1 : 0]; 1: [head: TN[5], head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[6 extends TN["length"] ? 1 : 0]; 1: [head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[5 extends TN["length"] ? 1 : 0]; 1: [head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [head: TN[2], head: TN[1], head: TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)["length"] ? 1 : 0]; 1: [head: ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[9 extends TN["length"] ? 1 : 0]; 1: [head: TN[7], head: TN[6], head: TN[5], head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[8 extends TN["length"] ? 1 : 0]; 1: [head: TN[6], head: TN[5], head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[7 extends TN["length"] ? 1 : 0]; 1: [head: TN[5], head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[6 extends TN["length"] ? 1 : 0]; 1: [head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[5 extends TN["length"] ? 1 : 0]; 1: [head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [head: TN[2], head: TN[1], head: TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)[0], args: ...({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[11 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>>; }[10 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>; }[9 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>; }[8 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>; }[7 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>; }[6 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>; }[5 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>; }[4 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>; }[3 extends I["length"] ? 1 : 0]; 1: Tools.Tail>; }[2 extends I["length"] ? 1 : 0]; 1: Tools.Tail; }[1 extends I["length"] ? 1 : 0]; 1: T2; }[0 extends I["length"] ? 1 : 0] extends infer D ? Tools.Cast : never)[number][]]; }[1 extends ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[10 extends TN["length"] ? 1 : 0]; 1: [head: TN[8], head: TN[7], head: TN[6], head: TN[5], head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[9 extends TN["length"] ? 1 : 0]; 1: [head: TN[7], head: TN[6], head: TN[5], head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[8 extends TN["length"] ? 1 : 0]; 1: [head: TN[6], head: TN[5], head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[7 extends TN["length"] ? 1 : 0]; 1: [head: TN[5], head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[6 extends TN["length"] ? 1 : 0]; 1: [head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[5 extends TN["length"] ? 1 : 0]; 1: [head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [head: TN[2], head: TN[1], head: TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)["length"] ? 1 : 0]; 1: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[11 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>>; }[10 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>>; }[9 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>>; }[8 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>>; }[7 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>>; }[6 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>>; }[5 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>>; }[4 extends I["length"] ? 1 : 0]; 1: Tools.Tail>>; }[3 extends I["length"] ? 1 : 0]; 1: Tools.Tail>; }[2 extends I["length"] ? 1 : 0]; 1: Tools.Tail; }[1 extends I["length"] ? 1 : 0]; 1: T2; }[0 extends I["length"] ? 1 : 0] extends infer D ? Tools.Cast : never; }[0 extends ({ 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: { 0: any[11 extends TN["length"] ? 1 : 0]; 1: [head: TN[9], head: TN[8], head: TN[7], head: TN[6], head: TN[5], head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[10 extends TN["length"] ? 1 : 0]; 1: [head: TN[8], head: TN[7], head: TN[6], head: TN[5], head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[9 extends TN["length"] ? 1 : 0]; 1: [head: TN[7], head: TN[6], head: TN[5], head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[8 extends TN["length"] ? 1 : 0]; 1: [head: TN[6], head: TN[5], head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[7 extends TN["length"] ? 1 : 0]; 1: [head: TN[5], head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[6 extends TN["length"] ? 1 : 0]; 1: [head: TN[4], head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[5 extends TN["length"] ? 1 : 0]; 1: [head: TN[3], head: TN[2], head: TN[1], head: TN[0]]; }[4 extends TN["length"] ? 1 : 0]; 1: [head: TN[2], head: TN[1], head: TN[0]]; }[3 extends TN["length"] ? 1 : 0]; 1: [head: TN[1], head: TN[0]]; }[2 extends TN["length"] ? 1 : 0]; 1: [head: TN[0]]; }[1 extends TN["length"] ? 1 : 0]; 1: []; }[0 extends TN["length"] ? 1 : 0] extends infer R ? Tools.Cast : never)["length"] ? 1 : 0] >Tools : any >Tools : any >Tools : any diff --git a/tests/baselines/reference/restTuplesFromContextualTypes.errors.txt b/tests/baselines/reference/restTuplesFromContextualTypes.errors.txt index 5f2c299735b0b..6882f306b2063 100644 --- a/tests/baselines/reference/restTuplesFromContextualTypes.errors.txt +++ b/tests/baselines/reference/restTuplesFromContextualTypes.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/types/rest/restTuplesFromContextualTypes.ts(56,7): error TS2345: Argument of type '(a: number, b: T[0], ...x: T[number][]) => void' is not assignable to parameter of type '(x: number, ...args: T) => void'. Types of parameters 'b' and 'args' are incompatible. - Type 'T' is not assignable to type '[T[0], ...T[number][]]'. - Property '0' is missing in type 'any[]' but required in type '[T[0], ...T[number][]]'. + Type 'T' is not assignable to type '[b: T[0], x: ...T[number][]]'. + Property '0' is missing in type 'any[]' but required in type '[b: T[0], x: ...T[number][]]'. ==== tests/cases/conformance/types/rest/restTuplesFromContextualTypes.ts (1 errors) ==== @@ -64,8 +64,8 @@ tests/cases/conformance/types/rest/restTuplesFromContextualTypes.ts(56,7): error ~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(a: number, b: T[0], ...x: T[number][]) => void' is not assignable to parameter of type '(x: number, ...args: T) => void'. !!! error TS2345: Types of parameters 'b' and 'args' are incompatible. -!!! error TS2345: Type 'T' is not assignable to type '[T[0], ...T[number][]]'. -!!! error TS2345: Property '0' is missing in type 'any[]' but required in type '[T[0], ...T[number][]]'. +!!! error TS2345: Type 'T' is not assignable to type '[b: T[0], x: ...T[number][]]'. +!!! error TS2345: Property '0' is missing in type 'any[]' but required in type '[b: T[0], x: ...T[number][]]'. } declare function f5(f: (...args: T) => U): (...args: T) => U; diff --git a/tests/baselines/reference/restTuplesFromContextualTypes.types b/tests/baselines/reference/restTuplesFromContextualTypes.types index 6dd2a6d90cb68..a5da0659c23d1 100644 --- a/tests/baselines/reference/restTuplesFromContextualTypes.types +++ b/tests/baselines/reference/restTuplesFromContextualTypes.types @@ -68,14 +68,14 @@ f1((...x) => {}) >f1((...x) => {}) : void >f1 : (cb: (args_0: number, args_1: boolean, args_2: string) => void) => void >(...x) => {} : (args_0: number, args_1: boolean, args_2: string) => void ->x : [number, boolean, string] +>x : [args_0: number, args_1: boolean, args_2: string] f1((a, ...x) => {}) >f1((a, ...x) => {}) : void >f1 : (cb: (args_0: number, args_1: boolean, args_2: string) => void) => void >(a, ...x) => {} : (a: number, args_1: boolean, args_2: string) => void >a : number ->x : [boolean, string] +>x : [args_1: boolean, args_2: string] f1((a, b, ...x) => {}) >f1((a, b, ...x) => {}) : void @@ -83,7 +83,7 @@ f1((a, b, ...x) => {}) >(a, b, ...x) => {} : (a: number, b: boolean, args_2: string) => void >a : number >b : boolean ->x : [string] +>x : [args_2: string] f1((a, b, c, ...x) => {}) >f1((a, b, c, ...x) => {}) : void @@ -163,14 +163,14 @@ f2((...x) => {}) >f2((...x) => {}) : void >f2 : (cb: (args_0: number, args_1: boolean, ...args_2: string[]) => void) => void >(...x) => {} : (args_0: number, args_1: boolean, ...args_2: string[]) => void ->x : [number, boolean, ...string[]] +>x : [args_0: number, args_1: boolean, args_2: ...string[]] f2((a, ...x) => {}) >f2((a, ...x) => {}) : void >f2 : (cb: (args_0: number, args_1: boolean, ...args_2: string[]) => void) => void >(a, ...x) => {} : (a: number, args_1: boolean, ...args_2: string[]) => void >a : number ->x : [boolean, ...string[]] +>x : [args_1: boolean, args_2: ...string[]] f2((a, b, ...x) => {}) >f2((a, b, ...x) => {}) : void @@ -264,14 +264,14 @@ f3((...x) => {}) >f3((...x) => {}) : void >f3 : (cb: (x: number, args_0: boolean, ...args_1: string[]) => void) => void >(...x) => {} : (x: number, args_0: boolean, ...args_1: string[]) => void ->x : [number, boolean, ...string[]] +>x : [x: number, args_0: boolean, args_1: ...string[]] f3((a, ...x) => {}) >f3((a, ...x) => {}) : void >f3 : (cb: (x: number, args_0: boolean, ...args_1: string[]) => void) => void >(a, ...x) => {} : (a: number, args_0: boolean, ...args_1: string[]) => void >a : number ->x : [boolean, ...string[]] +>x : [args_0: boolean, args_1: ...string[]] f3((a, b, ...x) => {}) >f3((a, b, ...x) => {}) : void @@ -333,7 +333,7 @@ function f4(t: T) { >f((...x) => {}) : void >f : (cb: (x: number, ...args: T) => void) => void >(...x) => {} : (x: number, ...args: T[number][]) => void ->x : [number, ...T[number][]] +>x : [x: number, args: ...T[number][]] f((a, ...x) => {}); >f((a, ...x) => {}) : void @@ -496,7 +496,7 @@ take(function(...rest){}); >take(function(...rest){}) : void >take : (cb: (a: number, b: string) => void) => void >function(...rest){} : (a: number, b: string) => void ->rest : [number, string] +>rest : [a: number, b: string] // Repro from #29833 diff --git a/tests/baselines/reference/strictBindCallApply1.errors.txt b/tests/baselines/reference/strictBindCallApply1.errors.txt index cd30931bcfe4a..f7d9231a12a3f 100644 --- a/tests/baselines/reference/strictBindCallApply1.errors.txt +++ b/tests/baselines/reference/strictBindCallApply1.errors.txt @@ -9,10 +9,10 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(11,11): error TS2769: tests/cases/conformance/functions/strictBindCallApply1.ts(17,15): error TS2554: Expected 3 arguments, but got 2. tests/cases/conformance/functions/strictBindCallApply1.ts(18,35): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(19,44): error TS2554: Expected 3 arguments, but got 4. -tests/cases/conformance/functions/strictBindCallApply1.ts(22,32): error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'. - Property '1' is missing in type '[number]' but required in type '[number, string]'. +tests/cases/conformance/functions/strictBindCallApply1.ts(22,32): error TS2345: Argument of type '[number]' is not assignable to parameter of type '[a: number, b: string]'. + Property '1' is missing in type '[number]' but required in type '[a: number, b: string]'. tests/cases/conformance/functions/strictBindCallApply1.ts(23,37): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/conformance/functions/strictBindCallApply1.ts(24,32): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. +tests/cases/conformance/functions/strictBindCallApply1.ts(24,32): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[a: number, b: string]'. Types of property 'length' are incompatible. Type '3' is not assignable to type '2'. tests/cases/conformance/functions/strictBindCallApply1.ts(41,11): error TS2769: No overload matches this call. @@ -35,9 +35,9 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(48,17): error TS2554: tests/cases/conformance/functions/strictBindCallApply1.ts(49,29): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(50,38): error TS2554: Expected 3 arguments, but got 4. tests/cases/conformance/functions/strictBindCallApply1.ts(51,22): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. -tests/cases/conformance/functions/strictBindCallApply1.ts(54,26): error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'. +tests/cases/conformance/functions/strictBindCallApply1.ts(54,26): error TS2345: Argument of type '[number]' is not assignable to parameter of type '[a: number, b: string]'. tests/cases/conformance/functions/strictBindCallApply1.ts(55,31): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/conformance/functions/strictBindCallApply1.ts(56,26): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. +tests/cases/conformance/functions/strictBindCallApply1.ts(56,26): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[a: number, b: string]'. tests/cases/conformance/functions/strictBindCallApply1.ts(57,23): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. tests/cases/conformance/functions/strictBindCallApply1.ts(62,11): error TS2769: No overload matches this call. Overload 1 of 6, '(this: new (arg0: 10, arg1: string) => C, thisArg: any, arg0: 10, arg1: string): new () => C', gave the following error. @@ -50,9 +50,9 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(62,11): error TS2769: tests/cases/conformance/functions/strictBindCallApply1.ts(65,3): error TS2554: Expected 3 arguments, but got 2. tests/cases/conformance/functions/strictBindCallApply1.ts(66,15): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(67,24): error TS2554: Expected 3 arguments, but got 4. -tests/cases/conformance/functions/strictBindCallApply1.ts(70,12): error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'. +tests/cases/conformance/functions/strictBindCallApply1.ts(70,12): error TS2345: Argument of type '[number]' is not assignable to parameter of type '[a: number, b: string]'. tests/cases/conformance/functions/strictBindCallApply1.ts(71,17): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. +tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[a: number, b: string]'. ==== tests/cases/conformance/functions/strictBindCallApply1.ts (24 errors) ==== @@ -94,14 +94,14 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: let a00 = foo.apply(undefined, [10, "hello"]); let a01 = foo.apply(undefined, [10]); // Error ~~~~ -!!! error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'. -!!! error TS2345: Property '1' is missing in type '[number]' but required in type '[number, string]'. +!!! error TS2345: Argument of type '[number]' is not assignable to parameter of type '[a: number, b: string]'. +!!! error TS2345: Property '1' is missing in type '[number]' but required in type '[a: number, b: string]'. let a02 = foo.apply(undefined, [10, 20]); // Error ~~ !!! error TS2322: Type 'number' is not assignable to type 'string'. let a03 = foo.apply(undefined, [10, "hello", 30]); // Error ~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. +!!! error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[a: number, b: string]'. !!! error TS2345: Types of property 'length' are incompatible. !!! error TS2345: Type '3' is not assignable to type '2'. @@ -161,13 +161,13 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: let a10 = c.foo.apply(c, [10, "hello"]); let a11 = c.foo.apply(c, [10]); // Error ~~~~ -!!! error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'. +!!! error TS2345: Argument of type '[number]' is not assignable to parameter of type '[a: number, b: string]'. let a12 = c.foo.apply(c, [10, 20]); // Error ~~ !!! error TS2322: Type 'number' is not assignable to type 'string'. let a13 = c.foo.apply(c, [10, "hello", 30]); // Error ~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. +!!! error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[a: number, b: string]'. let a14 = c.foo.apply(undefined, [10, "hello"]); // Error ~~~~~~~~~ !!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. @@ -200,11 +200,11 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: C.apply(c, [10, "hello"]); C.apply(c, [10]); // Error ~~~~ -!!! error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'. +!!! error TS2345: Argument of type '[number]' is not assignable to parameter of type '[a: number, b: string]'. C.apply(c, [10, 20]); // Error ~~ !!! error TS2322: Type 'number' is not assignable to type 'string'. C.apply(c, [10, "hello", 30]); // Error ~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. +!!! error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[a: number, b: string]'. \ No newline at end of file diff --git a/tests/cases/conformance/types/tuple/named/namedTupleMembers.ts b/tests/cases/conformance/types/tuple/named/namedTupleMembers.ts new file mode 100644 index 0000000000000..0f9371184e149 --- /dev/null +++ b/tests/cases/conformance/types/tuple/named/namedTupleMembers.ts @@ -0,0 +1,27 @@ +// @declaration: true + +export type Segment = [length: number, count: number]; + +export type SegmentAnnotated = [ + /** + * Size of message buffer segment handles + */ + length: number, + /** + * Number of segments handled at once + */ + count: number +]; + +export type Func = (...x: T) => void; + +export const c = null as any as Func; + +export function useState(initial: T): [value: T, setter: (T) => void] { + return null as any; +} + + +export type Iter = Func<[step: number, iterations: number]>; + +export function readSegment([length, count]: [number, number]) {} \ No newline at end of file diff --git a/tests/cases/conformance/types/tuple/named/namedTupleMembersErrors.ts b/tests/cases/conformance/types/tuple/named/namedTupleMembersErrors.ts new file mode 100644 index 0000000000000..d5eaaf7f4beef --- /dev/null +++ b/tests/cases/conformance/types/tuple/named/namedTupleMembersErrors.ts @@ -0,0 +1,11 @@ +// @declaration: true + +export type Segment1 = [length: number, number]; // partially named, disallowed + +export type List = [item: any, ...any]; // partially named, disallowed + +export type Pair = [item: any, any?]; // partially named, disallowed + +export type Opt = [element?: string]; // question mark on name disallowed + +export type Trailing = [first: string, ...rest: string[]] // dots on name disallowed \ No newline at end of file diff --git a/tests/cases/fourslash/contextuallyTypedParameters.ts b/tests/cases/fourslash/contextuallyTypedParameters.ts index f600180c08725..b19ec282eb64d 100644 --- a/tests/cases/fourslash/contextuallyTypedParameters.ts +++ b/tests/cases/fourslash/contextuallyTypedParameters.ts @@ -40,19 +40,19 @@ verify.quickInfos({ 10: "(parameter) a: number", - 11: "(parameter) args: [string, boolean]", + 11: "(parameter) args: [y: string, z: boolean]", 20: "(parameter) a: number", 21: "(parameter) b: string", - 22: "(parameter) args: [boolean]", + 22: "(parameter) args: [z: boolean]", 30: "(parameter) a: number", 31: "(parameter) b: string", 32: "(parameter) c: boolean", 33: "(parameter) args: []", 40: "(parameter) a: number", - 41: "(parameter) args: [string, boolean]", + 41: "(parameter) args: [y: string, z: boolean]", 50: "(parameter) a: number", 51: "(parameter) b: string", - 52: "(parameter) args: [boolean]", + 52: "(parameter) args: [z: boolean]", 60: "(parameter) a: number", 61: "(parameter) b: string", 62: "(parameter) c: boolean", diff --git a/tests/cases/fourslash/namedTupleMembers.ts b/tests/cases/fourslash/namedTupleMembers.ts new file mode 100644 index 0000000000000..034570e715ffe --- /dev/null +++ b/tests/cases/fourslash/namedTupleMembers.ts @@ -0,0 +1,5 @@ +/// + +////export type /*1*/Segment = [length: number, count: number]; + +verify.quickInfoAt("1", "type Segment = [length: number, count: number]"); \ No newline at end of file diff --git a/tests/cases/fourslash/restArgType.ts b/tests/cases/fourslash/restArgType.ts index 69601c14ccfb2..a89c2b38ba8dd 100644 --- a/tests/cases/fourslash/restArgType.ts +++ b/tests/cases/fourslash/restArgType.ts @@ -38,12 +38,12 @@ verify.quickInfos({ 4: "(parameter) y1: string[]", 5: "(parameter) y2: string", - t1: "(parameter) f1: [string, string]", + t1: "(parameter) f1: [a1: string, a2: string]", - t2: "(parameter) f1: [string, ...string[]]", + t2: "(parameter) f1: [a1: string, a2: ...string[]]", t31: "(parameter) f1: number", - t32: "(parameter) f2: [boolean, ...string[]]", + t32: "(parameter) f2: [a2: boolean, c: ...string[]]", t4: "(parameter) f1: string[]", t5: "(parameter) f1: string",