diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 1bb5c6a2977..404bfdb4a6b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -10409,7 +10409,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { // If the parent is a tuple type, the rest element has a tuple type of the // remaining tuple element types. Otherwise, the rest element has an array type with same // element type as the parent type. - const baseConstraint = getBaseConstraintOrType(parentType); + const baseConstraint = mapType(parentType, t => t.flags & TypeFlags.InstantiableNonPrimitive ? getBaseConstraintOrType(t) : t); type = everyType(baseConstraint, isTupleType) ? mapType(baseConstraint, t => sliceTupleType(t as TupleTypeReference, index)) : createArrayType(elementType); @@ -12556,6 +12556,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { return needApparentType ? getApparentType(type) : type; } + function getThisArgument(type: Type) { + return getObjectFlags(type) & ObjectFlags.Reference && length(getTypeArguments(type as TypeReference)) > getTypeReferenceArity(type as TypeReference) ? last(getTypeArguments(type as TypeReference)) : type; + } + function resolveObjectTypeMembers(type: ObjectType, source: InterfaceTypeWithDeclaredMembers, typeParameters: readonly TypeParameter[], typeArguments: readonly Type[]) { let mapper: TypeMapper | undefined; let members: SymbolTable; @@ -12685,7 +12689,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { return [sig.parameters]; function expandSignatureParametersWithTupleMembers(restType: TupleTypeReference, restIndex: number) { - const elementTypes = getTypeArguments(restType); + const elementTypes = getElementTypes(restType); const associatedNames = getUniqAssociatedNamesFromTupleType(restType); const restParams = map(elementTypes, (t, i) => { // Lookup the label from the individual tuple passed in before falling back to the signature `rest` parameter name @@ -13583,7 +13587,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { type.flags & TypeFlags.IndexedAccess && isConstTypeVariable((type as IndexedAccessType).objectType) || type.flags & TypeFlags.Conditional && isConstTypeVariable(getConstraintOfConditionalType(type as ConditionalType)) || type.flags & TypeFlags.Substitution && isConstTypeVariable((type as SubstitutionType).baseType) || - isGenericTupleType(type) && findIndex(getTypeArguments(type), (t, i) => !!(type.target.elementFlags[i] & ElementFlags.Variadic) && isConstTypeVariable(t)) >= 0)); + isGenericTupleType(type) && findIndex(getElementTypes(type), (t, i) => !!(type.target.elementFlags[i] & ElementFlags.Variadic) && isConstTypeVariable(t)) >= 0)); } function getConstraintOfIndexedAccess(type: IndexedAccessType) { @@ -13708,7 +13712,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } function getBaseConstraintOfType(type: Type): Type | undefined { - if (type.flags & (TypeFlags.InstantiableNonPrimitive | TypeFlags.UnionOrIntersection | TypeFlags.TemplateLiteral | TypeFlags.StringMapping)) { + if (type.flags & (TypeFlags.InstantiableNonPrimitive | TypeFlags.UnionOrIntersection | TypeFlags.TemplateLiteral | TypeFlags.StringMapping) || isGenericTupleType(type)) { const constraint = getResolvedBaseConstraint(type as InstantiableType | UnionOrIntersectionType); return constraint !== noConstraintType && constraint !== circularConstraintType ? constraint : undefined; } @@ -13737,7 +13741,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { return type.resolvedBaseConstraint; } const stack: object[] = []; - return type.resolvedBaseConstraint = getTypeWithThisArgument(getImmediateBaseConstraint(type), type); + return type.resolvedBaseConstraint = getTypeWithThisArgument(getImmediateBaseConstraint(type), getThisArgument(type)); function getImmediateBaseConstraint(t: Type): Type { if (!t.immediateBaseConstraint) { @@ -13839,6 +13843,15 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { if (t.flags & TypeFlags.Substitution) { return getBaseConstraint(getSubstitutionIntersection(t as SubstitutionType)); } + if (isGenericTupleType(t)) { + // We substitute constraints for variadic elements only when the constraints are array types or + // non-variadic tuple types as we want to avoid further (possibly unbounded) recursion. + const newElements = map(getElementTypes(t), (v, i) => { + const constraint = t.target.elementFlags[i] & ElementFlags.Variadic && getBaseConstraint(v) || v; + return constraint && everyType(constraint, c => isArrayOrTupleType(c) && !isGenericTupleType(c)) ? constraint : v; + }); + return createTupleType(newElements, t.target.elementFlags, t.target.readonly, t.target.labeledElementDeclarations); + } return t; } } @@ -16147,7 +16160,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { addElement(type, ElementFlags.Variadic, target.labeledElementDeclarations?.[i]); } else if (isTupleType(type)) { - const elements = getTypeArguments(type); + const elements = getElementTypes(type); if (elements.length + expandedTypes.length >= 10_000) { error(currentNode, isPartOfTypeNode(currentNode!) ? Diagnostics.Type_produces_a_tuple_type_that_is_too_large_to_represent @@ -16229,6 +16242,12 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { return type.elementFlags.length - findLastIndex(type.elementFlags, f => !(f & flags)) - 1; } + function getElementTypes(type: TupleTypeReference): readonly Type[] { + const typeArguments = getTypeArguments(type); + const arity = getTypeReferenceArity(type); + return typeArguments.length === arity ? typeArguments : typeArguments.slice(0, arity); + } + function getTypeFromOptionalTypeNode(node: OptionalTypeNode): Type { return addOptionality(getTypeFromTypeNode(node.type), /*isProperty*/ true); } @@ -17779,7 +17798,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } function isDeferredType(type: Type, checkTuples: boolean) { - return isGenericType(type) || checkTuples && isTupleType(type) && some(getTypeArguments(type), isGenericType); + return isGenericType(type) || checkTuples && isTupleType(type) && some(getElementTypes(type), isGenericType); } function getConditionalType(root: ConditionalRoot, mapper: TypeMapper | undefined, aliasSymbol?: Symbol, aliasTypeArguments?: readonly Type[]): Type { @@ -18920,7 +18939,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { // M<[A, B?, ...T, ...C[]] into [...M<[A]>, ...M<[B?]>, ...M, ...M] and then rely on tuple type // normalization to resolve the non-generic parts of the resulting tuple. const elementFlags = tupleType.target.elementFlags; - const elementTypes = map(getTypeArguments(tupleType), (t, i) => { + const elementTypes = map(getElementTypes(tupleType), (t, i) => { const singleton = elementFlags[i] & ElementFlags.Variadic ? t : elementFlags[i] & ElementFlags.Rest ? createArrayType(t) : createTupleType([t], [elementFlags[i]]); @@ -18939,7 +18958,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { function instantiateMappedTupleType(tupleType: TupleTypeReference, mappedType: MappedType, mapper: TypeMapper) { const elementFlags = tupleType.target.elementFlags; - const elementTypes = map(getTypeArguments(tupleType), (_, i) => + const elementTypes = map(getElementTypes(tupleType), (_, i) => instantiateMappedTypeTemplate(mappedType, getStringLiteralType("" + i), !!(elementFlags[i] & ElementFlags.Optional), mapper)); const modifiers = getMappedTypeModifiers(mappedType); const newTupleModifiers = modifiers & MappedTypeModifiers.IncludeOptional ? map(elementFlags, f => f & ElementFlags.Required ? ElementFlags.Optional : f) : @@ -20244,7 +20263,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } function getNormalizedTupleType(type: TupleTypeReference, writing: boolean): Type { - const elements = getTypeArguments(type); + const elements = getElementTypes(type); const normalizedElements = sameMap(elements, t => t.flags & TypeFlags.Simplifiable ? getSimplifiedType(t, writing) : t); return elements !== normalizedElements ? createNormalizedTupleType(type.target, normalizedElements) : type; } @@ -21802,6 +21821,12 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { return Ternary.False; } } + else if (isGenericTupleType(source) && isTupleType(target) && !isGenericTupleType(target)) { + const constraint = getBaseConstraintOrType(source); + if (constraint !== source) { + return isRelatedTo(constraint, target, RecursionFlags.Source, reportErrors); + } + } // A fresh empty object type is never a subtype of a non-empty object type. This ensures fresh({}) <: { [x: string]: xxx } // but not vice-versa. Without this rule, those types would be mutual subtypes. else if ((relation === subtypeRelation || relation === strictSubtypeRelation) && isEmptyObjectType(target) && getObjectFlags(target) & ObjectFlags.FreshLiteral && !isEmptyObjectType(source)) { @@ -24083,7 +24108,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { function isPartiallyInferableType(type: Type): boolean { return !(getObjectFlags(type) & ObjectFlags.NonInferrableType) || isObjectLiteralType(type) && some(getPropertiesOfType(type), prop => isPartiallyInferableType(getTypeOfSymbol(prop))) || - isTupleType(type) && some(getTypeArguments(type), isPartiallyInferableType); + isTupleType(type) && some(getElementTypes(type), isPartiallyInferableType); } function createReverseMappedType(source: Type, target: MappedType, constraint: IndexType) { @@ -24098,7 +24123,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { return createArrayType(inferReverseMappedType(getTypeArguments(source)[0], target, constraint), isReadonlyArrayType(source)); } if (isTupleType(source)) { - const elementTypes = map(getTypeArguments(source), t => inferReverseMappedType(t, target, constraint)); + const elementTypes = map(getElementTypes(source), t => inferReverseMappedType(t, target, constraint)); const elementFlags = getMappedTypeModifiers(target) & MappedTypeModifiers.IncludeOptional ? sameMap(source.target.elementFlags, f => f & ElementFlags.Optional ? ElementFlags.Required : f) : source.target.elementFlags; @@ -32491,7 +32516,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { function getMutableArrayOrTupleType(type: Type) { return type.flags & TypeFlags.Union ? mapType(type, getMutableArrayOrTupleType) : type.flags & TypeFlags.Any || isMutableArrayOrTuple(getBaseConstraintOfType(type) || type) ? type : - isTupleType(type) ? createTupleType(getTypeArguments(type), type.target.elementFlags, /*readonly*/ false, type.target.labeledElementDeclarations) : + isTupleType(type) ? createTupleType(getElementTypes(type), type.target.elementFlags, /*readonly*/ false, type.target.labeledElementDeclarations) : createTupleType([type], [ElementFlags.Variadic]); } @@ -32825,7 +32850,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { // We can call checkExpressionCached because spread expressions never have a contextual type. const spreadType = arg.kind === SyntaxKind.SpreadElement && (flowLoopCount ? checkExpression((arg as SpreadElement).expression) : checkExpressionCached((arg as SpreadElement).expression)); if (spreadType && isTupleType(spreadType)) { - forEach(getTypeArguments(spreadType), (t, i) => { + forEach(getElementTypes(spreadType), (t, i) => { const flags = spreadType.target.elementFlags[i]; const syntheticArg = createSyntheticExpression(arg, flags & ElementFlags.Rest ? createArrayType(t) : t, !!(flags & ElementFlags.Variable), spreadType.target.labeledElementDeclarations?.[i]); @@ -37436,7 +37461,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { function padTupleType(type: TupleTypeReference, pattern: ArrayBindingPattern) { const patternElements = pattern.elements; - const elementTypes = getTypeArguments(type).slice(); + const elementTypes = getElementTypes(type).slice(); const elementFlags = type.target.elementFlags.slice(); for (let i = getTypeReferenceArity(type); i < patternElements.length; i++) { const e = patternElements[i]; diff --git a/tests/baselines/reference/variadicTuples1.errors.txt b/tests/baselines/reference/variadicTuples1.errors.txt index 7058df28394..d04497b76c5 100644 --- a/tests/baselines/reference/variadicTuples1.errors.txt +++ b/tests/baselines/reference/variadicTuples1.errors.txt @@ -35,13 +35,20 @@ tests/cases/conformance/types/tuple/variadicTuples1.ts(191,5): error TS2322: Typ 'T' is assignable to the constraint of type 'U', but 'U' could be instantiated with a different subtype of constraint 'readonly string[]'. tests/cases/conformance/types/tuple/variadicTuples1.ts(203,5): error TS2322: Type 'string' is not assignable to type 'keyof [1, 2, ...T]'. Type '"2"' is not assignable to type '"0" | "1" | keyof T[]'. -tests/cases/conformance/types/tuple/variadicTuples1.ts(357,26): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/tuple/variadicTuples1.ts(397,7): error TS2322: Type '[boolean, false]' is not assignable to type '[...number[], boolean]'. +tests/cases/conformance/types/tuple/variadicTuples1.ts(213,5): error TS2322: Type '[...T, ...T]' is not assignable to type '[unknown, unknown]'. + Type '[] | [unknown] | [unknown, unknown]' is not assignable to type '[unknown, unknown]'. + Type '[]' is not assignable to type '[unknown, unknown]'. + Source has 0 element(s) but target requires 2. +tests/cases/conformance/types/tuple/variadicTuples1.ts(217,5): error TS2322: Type '[...T, ...T]' is not assignable to type '[unknown, unknown]'. + Type 'unknown[]' is not assignable to type '[unknown, unknown]'. + Target requires 2 element(s) but source may have fewer. +tests/cases/conformance/types/tuple/variadicTuples1.ts(371,26): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/tuple/variadicTuples1.ts(411,7): error TS2322: Type '[boolean, false]' is not assignable to type '[...number[], boolean]'. Type at position 0 in source is not compatible with type at position 0 in target. Type 'boolean' is not assignable to type 'number'. -==== tests/cases/conformance/types/tuple/variadicTuples1.ts (20 errors) ==== +==== tests/cases/conformance/types/tuple/variadicTuples1.ts (22 errors) ==== // Variadics in tuple types type TV0 = [string, ...T]; @@ -303,6 +310,29 @@ tests/cases/conformance/types/tuple/variadicTuples1.ts(397,7): error TS2322: Typ !!! error TS2322: Type '"2"' is not assignable to type '"0" | "1" | keyof T[]'. } + // Constraints of variadic tuple types + + function ft16(x: [unknown, unknown], y: [...T, ...T]) { + x = y; + } + + function ft17(x: [unknown, unknown], y: [...T, ...T]) { + x = y; + ~ +!!! error TS2322: Type '[...T, ...T]' is not assignable to type '[unknown, unknown]'. +!!! error TS2322: Type '[] | [unknown] | [unknown, unknown]' is not assignable to type '[unknown, unknown]'. +!!! error TS2322: Type '[]' is not assignable to type '[unknown, unknown]'. +!!! error TS2322: Source has 0 element(s) but target requires 2. + } + + function ft18(x: [unknown, unknown], y: [...T, ...T]) { + x = y; + ~ +!!! error TS2322: Type '[...T, ...T]' is not assignable to type '[unknown, unknown]'. +!!! error TS2322: Type 'unknown[]' is not assignable to type '[unknown, unknown]'. +!!! error TS2322: Target requires 2 element(s) but source may have fewer. + } + // Inference between variadic tuple types type First = @@ -505,4 +535,9 @@ tests/cases/conformance/types/tuple/variadicTuples1.ts(397,7): error TS2322: Typ type U1 = [string, ...Numbers, boolean]; type U2 = [...[string, ...Numbers], boolean]; type U3 = [...[string, number], boolean]; + + // Repro from #53563 + + type ToStringLength1 = `${T['length']}`; + type ToStringLength2 = `${[...T]['length']}`; \ No newline at end of file diff --git a/tests/baselines/reference/variadicTuples1.js b/tests/baselines/reference/variadicTuples1.js index 443176fc9a4..9bcd2eb064d 100644 --- a/tests/baselines/reference/variadicTuples1.js +++ b/tests/baselines/reference/variadicTuples1.js @@ -204,6 +204,20 @@ function f15(k0: keyof T, k1: keyof [...T], k2: k3 = '2'; // Error } +// Constraints of variadic tuple types + +function ft16(x: [unknown, unknown], y: [...T, ...T]) { + x = y; +} + +function ft17(x: [unknown, unknown], y: [...T, ...T]) { + x = y; +} + +function ft18(x: [unknown, unknown], y: [...T, ...T]) { + x = y; +} + // Inference between variadic tuple types type First = @@ -400,6 +414,11 @@ const data: Unbounded = [false, false]; // Error type U1 = [string, ...Numbers, boolean]; type U2 = [...[string, ...Numbers], boolean]; type U3 = [...[string, number], boolean]; + +// Repro from #53563 + +type ToStringLength1 = `${T['length']}`; +type ToStringLength2 = `${[...T]['length']}`; //// [variadicTuples1.js] @@ -541,6 +560,16 @@ function f15(k0, k1, k2, k3) { k3 = '1'; k3 = '2'; // Error } +// Constraints of variadic tuple types +function ft16(x, y) { + x = y; +} +function ft17(x, y) { + x = y; +} +function ft18(x, y) { + x = y; +} // Inference to [...T, ...U] with implied arity for T function curry(f) { var a = []; @@ -677,6 +706,9 @@ declare function f12(t: T, m: [...T], r: readonly declare function f13(t0: T, t1: [...T], t2: [...U]): void; declare function f14(t0: T, t1: [...T], t2: [...U]): void; declare function f15(k0: keyof T, k1: keyof [...T], k2: keyof [...U], k3: keyof [1, 2, ...T]): void; +declare function ft16(x: [unknown, unknown], y: [...T, ...T]): void; +declare function ft17(x: [unknown, unknown], y: [...T, ...T]): void; +declare function ft18(x: [unknown, unknown], y: [...T, ...T]): void; type First = T extends readonly [unknown, ...unknown[]] ? T[0] : T[0] | undefined; type DropFirst = T extends readonly [unknown?, ...infer U] ? U : [...T]; type Last = T extends readonly [...unknown[], infer U] ? U : T extends readonly [unknown, ...unknown[]] ? T[number] : T[number] | undefined; @@ -794,3 +826,5 @@ declare const data: Unbounded; type U1 = [string, ...Numbers, boolean]; type U2 = [...[string, ...Numbers], boolean]; type U3 = [...[string, number], boolean]; +type ToStringLength1 = `${T['length']}`; +type ToStringLength2 = `${[...T]['length']}`; diff --git a/tests/baselines/reference/variadicTuples1.symbols b/tests/baselines/reference/variadicTuples1.symbols index a0914781656..8cc9e6029ca 100644 --- a/tests/baselines/reference/variadicTuples1.symbols +++ b/tests/baselines/reference/variadicTuples1.symbols @@ -692,672 +692,725 @@ function f15(k0: keyof T, k1: keyof [...T], k2: >k3 : Symbol(k3, Decl(variadicTuples1.ts, 193, 94)) } +// Constraints of variadic tuple types + +function ft16(x: [unknown, unknown], y: [...T, ...T]) { +>ft16 : Symbol(ft16, Decl(variadicTuples1.ts, 203, 1)) +>T : Symbol(T, Decl(variadicTuples1.ts, 207, 14)) +>x : Symbol(x, Decl(variadicTuples1.ts, 207, 35)) +>y : Symbol(y, Decl(variadicTuples1.ts, 207, 57)) +>T : Symbol(T, Decl(variadicTuples1.ts, 207, 14)) +>T : Symbol(T, Decl(variadicTuples1.ts, 207, 14)) + + x = y; +>x : Symbol(x, Decl(variadicTuples1.ts, 207, 35)) +>y : Symbol(y, Decl(variadicTuples1.ts, 207, 57)) +} + +function ft17(x: [unknown, unknown], y: [...T, ...T]) { +>ft17 : Symbol(ft17, Decl(variadicTuples1.ts, 209, 1)) +>T : Symbol(T, Decl(variadicTuples1.ts, 211, 14)) +>x : Symbol(x, Decl(variadicTuples1.ts, 211, 40)) +>y : Symbol(y, Decl(variadicTuples1.ts, 211, 62)) +>T : Symbol(T, Decl(variadicTuples1.ts, 211, 14)) +>T : Symbol(T, Decl(variadicTuples1.ts, 211, 14)) + + x = y; +>x : Symbol(x, Decl(variadicTuples1.ts, 211, 40)) +>y : Symbol(y, Decl(variadicTuples1.ts, 211, 62)) +} + +function ft18(x: [unknown, unknown], y: [...T, ...T]) { +>ft18 : Symbol(ft18, Decl(variadicTuples1.ts, 213, 1)) +>T : Symbol(T, Decl(variadicTuples1.ts, 215, 14)) +>x : Symbol(x, Decl(variadicTuples1.ts, 215, 35)) +>y : Symbol(y, Decl(variadicTuples1.ts, 215, 57)) +>T : Symbol(T, Decl(variadicTuples1.ts, 215, 14)) +>T : Symbol(T, Decl(variadicTuples1.ts, 215, 14)) + + x = y; +>x : Symbol(x, Decl(variadicTuples1.ts, 215, 35)) +>y : Symbol(y, Decl(variadicTuples1.ts, 215, 57)) +} + // Inference between variadic tuple types type First = ->First : Symbol(First, Decl(variadicTuples1.ts, 203, 1)) ->T : Symbol(T, Decl(variadicTuples1.ts, 207, 11)) +>First : Symbol(First, Decl(variadicTuples1.ts, 217, 1)) +>T : Symbol(T, Decl(variadicTuples1.ts, 221, 11)) T extends readonly [unknown, ...unknown[]] ? T[0] : ->T : Symbol(T, Decl(variadicTuples1.ts, 207, 11)) ->T : Symbol(T, Decl(variadicTuples1.ts, 207, 11)) +>T : Symbol(T, Decl(variadicTuples1.ts, 221, 11)) +>T : Symbol(T, Decl(variadicTuples1.ts, 221, 11)) T[0] | undefined; ->T : Symbol(T, Decl(variadicTuples1.ts, 207, 11)) +>T : Symbol(T, Decl(variadicTuples1.ts, 221, 11)) type DropFirst = T extends readonly [unknown?, ...infer U] ? U : [...T]; ->DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 209, 21)) ->T : Symbol(T, Decl(variadicTuples1.ts, 211, 15)) ->T : Symbol(T, Decl(variadicTuples1.ts, 211, 15)) ->U : Symbol(U, Decl(variadicTuples1.ts, 211, 85)) ->U : Symbol(U, Decl(variadicTuples1.ts, 211, 85)) ->T : Symbol(T, Decl(variadicTuples1.ts, 211, 15)) +>DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 223, 21)) +>T : Symbol(T, Decl(variadicTuples1.ts, 225, 15)) +>T : Symbol(T, Decl(variadicTuples1.ts, 225, 15)) +>U : Symbol(U, Decl(variadicTuples1.ts, 225, 85)) +>U : Symbol(U, Decl(variadicTuples1.ts, 225, 85)) +>T : Symbol(T, Decl(variadicTuples1.ts, 225, 15)) type Last = ->Last : Symbol(Last, Decl(variadicTuples1.ts, 211, 102)) ->T : Symbol(T, Decl(variadicTuples1.ts, 213, 10)) +>Last : Symbol(Last, Decl(variadicTuples1.ts, 225, 102)) +>T : Symbol(T, Decl(variadicTuples1.ts, 227, 10)) T extends readonly [...unknown[], infer U] ? U : ->T : Symbol(T, Decl(variadicTuples1.ts, 213, 10)) ->U : Symbol(U, Decl(variadicTuples1.ts, 214, 43)) ->U : Symbol(U, Decl(variadicTuples1.ts, 214, 43)) +>T : Symbol(T, Decl(variadicTuples1.ts, 227, 10)) +>U : Symbol(U, Decl(variadicTuples1.ts, 228, 43)) +>U : Symbol(U, Decl(variadicTuples1.ts, 228, 43)) T extends readonly [unknown, ...unknown[]] ? T[number] : ->T : Symbol(T, Decl(variadicTuples1.ts, 213, 10)) ->T : Symbol(T, Decl(variadicTuples1.ts, 213, 10)) +>T : Symbol(T, Decl(variadicTuples1.ts, 227, 10)) +>T : Symbol(T, Decl(variadicTuples1.ts, 227, 10)) T[number] | undefined; ->T : Symbol(T, Decl(variadicTuples1.ts, 213, 10)) +>T : Symbol(T, Decl(variadicTuples1.ts, 227, 10)) type DropLast = T extends readonly [...infer U, unknown] ? U : [...T]; ->DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 216, 26)) ->T : Symbol(T, Decl(variadicTuples1.ts, 218, 14)) ->T : Symbol(T, Decl(variadicTuples1.ts, 218, 14)) ->U : Symbol(U, Decl(variadicTuples1.ts, 218, 74)) ->U : Symbol(U, Decl(variadicTuples1.ts, 218, 74)) ->T : Symbol(T, Decl(variadicTuples1.ts, 218, 14)) +>DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 230, 26)) +>T : Symbol(T, Decl(variadicTuples1.ts, 232, 14)) +>T : Symbol(T, Decl(variadicTuples1.ts, 232, 14)) +>U : Symbol(U, Decl(variadicTuples1.ts, 232, 74)) +>U : Symbol(U, Decl(variadicTuples1.ts, 232, 74)) +>T : Symbol(T, Decl(variadicTuples1.ts, 232, 14)) type T00 = First<[number, symbol, string]>; ->T00 : Symbol(T00, Decl(variadicTuples1.ts, 218, 100)) ->First : Symbol(First, Decl(variadicTuples1.ts, 203, 1)) +>T00 : Symbol(T00, Decl(variadicTuples1.ts, 232, 100)) +>First : Symbol(First, Decl(variadicTuples1.ts, 217, 1)) type T01 = First<[symbol, string]>; ->T01 : Symbol(T01, Decl(variadicTuples1.ts, 220, 43)) ->First : Symbol(First, Decl(variadicTuples1.ts, 203, 1)) +>T01 : Symbol(T01, Decl(variadicTuples1.ts, 234, 43)) +>First : Symbol(First, Decl(variadicTuples1.ts, 217, 1)) type T02 = First<[string]>; ->T02 : Symbol(T02, Decl(variadicTuples1.ts, 221, 35)) ->First : Symbol(First, Decl(variadicTuples1.ts, 203, 1)) +>T02 : Symbol(T02, Decl(variadicTuples1.ts, 235, 35)) +>First : Symbol(First, Decl(variadicTuples1.ts, 217, 1)) type T03 = First<[number, symbol, ...string[]]>; ->T03 : Symbol(T03, Decl(variadicTuples1.ts, 222, 27)) ->First : Symbol(First, Decl(variadicTuples1.ts, 203, 1)) +>T03 : Symbol(T03, Decl(variadicTuples1.ts, 236, 27)) +>First : Symbol(First, Decl(variadicTuples1.ts, 217, 1)) type T04 = First<[symbol, ...string[]]>; ->T04 : Symbol(T04, Decl(variadicTuples1.ts, 223, 48)) ->First : Symbol(First, Decl(variadicTuples1.ts, 203, 1)) +>T04 : Symbol(T04, Decl(variadicTuples1.ts, 237, 48)) +>First : Symbol(First, Decl(variadicTuples1.ts, 217, 1)) type T05 = First<[string?]>; ->T05 : Symbol(T05, Decl(variadicTuples1.ts, 224, 40)) ->First : Symbol(First, Decl(variadicTuples1.ts, 203, 1)) +>T05 : Symbol(T05, Decl(variadicTuples1.ts, 238, 40)) +>First : Symbol(First, Decl(variadicTuples1.ts, 217, 1)) type T06 = First; ->T06 : Symbol(T06, Decl(variadicTuples1.ts, 225, 28)) ->First : Symbol(First, Decl(variadicTuples1.ts, 203, 1)) +>T06 : Symbol(T06, Decl(variadicTuples1.ts, 239, 28)) +>First : Symbol(First, Decl(variadicTuples1.ts, 217, 1)) type T07 = First<[]>; ->T07 : Symbol(T07, Decl(variadicTuples1.ts, 226, 27)) ->First : Symbol(First, Decl(variadicTuples1.ts, 203, 1)) +>T07 : Symbol(T07, Decl(variadicTuples1.ts, 240, 27)) +>First : Symbol(First, Decl(variadicTuples1.ts, 217, 1)) type T08 = First; ->T08 : Symbol(T08, Decl(variadicTuples1.ts, 227, 21)) ->First : Symbol(First, Decl(variadicTuples1.ts, 203, 1)) +>T08 : Symbol(T08, Decl(variadicTuples1.ts, 241, 21)) +>First : Symbol(First, Decl(variadicTuples1.ts, 217, 1)) type T09 = First; ->T09 : Symbol(T09, Decl(variadicTuples1.ts, 228, 22)) ->First : Symbol(First, Decl(variadicTuples1.ts, 203, 1)) +>T09 : Symbol(T09, Decl(variadicTuples1.ts, 242, 22)) +>First : Symbol(First, Decl(variadicTuples1.ts, 217, 1)) type T10 = DropFirst<[number, symbol, string]>; ->T10 : Symbol(T10, Decl(variadicTuples1.ts, 229, 24)) ->DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 209, 21)) +>T10 : Symbol(T10, Decl(variadicTuples1.ts, 243, 24)) +>DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 223, 21)) type T11 = DropFirst<[symbol, string]>; ->T11 : Symbol(T11, Decl(variadicTuples1.ts, 231, 47)) ->DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 209, 21)) +>T11 : Symbol(T11, Decl(variadicTuples1.ts, 245, 47)) +>DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 223, 21)) type T12 = DropFirst<[string]>; ->T12 : Symbol(T12, Decl(variadicTuples1.ts, 232, 39)) ->DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 209, 21)) +>T12 : Symbol(T12, Decl(variadicTuples1.ts, 246, 39)) +>DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 223, 21)) type T13 = DropFirst<[number, symbol, ...string[]]>; ->T13 : Symbol(T13, Decl(variadicTuples1.ts, 233, 31)) ->DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 209, 21)) +>T13 : Symbol(T13, Decl(variadicTuples1.ts, 247, 31)) +>DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 223, 21)) type T14 = DropFirst<[symbol, ...string[]]>; ->T14 : Symbol(T14, Decl(variadicTuples1.ts, 234, 52)) ->DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 209, 21)) +>T14 : Symbol(T14, Decl(variadicTuples1.ts, 248, 52)) +>DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 223, 21)) type T15 = DropFirst<[string?]>; ->T15 : Symbol(T15, Decl(variadicTuples1.ts, 235, 44)) ->DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 209, 21)) +>T15 : Symbol(T15, Decl(variadicTuples1.ts, 249, 44)) +>DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 223, 21)) type T16 = DropFirst; ->T16 : Symbol(T16, Decl(variadicTuples1.ts, 236, 32)) ->DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 209, 21)) +>T16 : Symbol(T16, Decl(variadicTuples1.ts, 250, 32)) +>DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 223, 21)) type T17 = DropFirst<[]>; ->T17 : Symbol(T17, Decl(variadicTuples1.ts, 237, 31)) ->DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 209, 21)) +>T17 : Symbol(T17, Decl(variadicTuples1.ts, 251, 31)) +>DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 223, 21)) type T18 = DropFirst; ->T18 : Symbol(T18, Decl(variadicTuples1.ts, 238, 25)) ->DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 209, 21)) +>T18 : Symbol(T18, Decl(variadicTuples1.ts, 252, 25)) +>DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 223, 21)) type T19 = DropFirst; ->T19 : Symbol(T19, Decl(variadicTuples1.ts, 239, 26)) ->DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 209, 21)) +>T19 : Symbol(T19, Decl(variadicTuples1.ts, 253, 26)) +>DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 223, 21)) type T20 = Last<[number, symbol, string]>; ->T20 : Symbol(T20, Decl(variadicTuples1.ts, 240, 28)) ->Last : Symbol(Last, Decl(variadicTuples1.ts, 211, 102)) +>T20 : Symbol(T20, Decl(variadicTuples1.ts, 254, 28)) +>Last : Symbol(Last, Decl(variadicTuples1.ts, 225, 102)) type T21 = Last<[symbol, string]>; ->T21 : Symbol(T21, Decl(variadicTuples1.ts, 242, 42)) ->Last : Symbol(Last, Decl(variadicTuples1.ts, 211, 102)) +>T21 : Symbol(T21, Decl(variadicTuples1.ts, 256, 42)) +>Last : Symbol(Last, Decl(variadicTuples1.ts, 225, 102)) type T22 = Last<[string]>; ->T22 : Symbol(T22, Decl(variadicTuples1.ts, 243, 34)) ->Last : Symbol(Last, Decl(variadicTuples1.ts, 211, 102)) +>T22 : Symbol(T22, Decl(variadicTuples1.ts, 257, 34)) +>Last : Symbol(Last, Decl(variadicTuples1.ts, 225, 102)) type T23 = Last<[number, symbol, ...string[]]>; ->T23 : Symbol(T23, Decl(variadicTuples1.ts, 244, 26)) ->Last : Symbol(Last, Decl(variadicTuples1.ts, 211, 102)) +>T23 : Symbol(T23, Decl(variadicTuples1.ts, 258, 26)) +>Last : Symbol(Last, Decl(variadicTuples1.ts, 225, 102)) type T24 = Last<[symbol, ...string[]]>; ->T24 : Symbol(T24, Decl(variadicTuples1.ts, 245, 47)) ->Last : Symbol(Last, Decl(variadicTuples1.ts, 211, 102)) +>T24 : Symbol(T24, Decl(variadicTuples1.ts, 259, 47)) +>Last : Symbol(Last, Decl(variadicTuples1.ts, 225, 102)) type T25 = Last<[string?]>; ->T25 : Symbol(T25, Decl(variadicTuples1.ts, 246, 39)) ->Last : Symbol(Last, Decl(variadicTuples1.ts, 211, 102)) +>T25 : Symbol(T25, Decl(variadicTuples1.ts, 260, 39)) +>Last : Symbol(Last, Decl(variadicTuples1.ts, 225, 102)) type T26 = Last; ->T26 : Symbol(T26, Decl(variadicTuples1.ts, 247, 27)) ->Last : Symbol(Last, Decl(variadicTuples1.ts, 211, 102)) +>T26 : Symbol(T26, Decl(variadicTuples1.ts, 261, 27)) +>Last : Symbol(Last, Decl(variadicTuples1.ts, 225, 102)) type T27 = Last<[]>; ->T27 : Symbol(T27, Decl(variadicTuples1.ts, 248, 26)) ->Last : Symbol(Last, Decl(variadicTuples1.ts, 211, 102)) +>T27 : Symbol(T27, Decl(variadicTuples1.ts, 262, 26)) +>Last : Symbol(Last, Decl(variadicTuples1.ts, 225, 102)) type T28 = Last; ->T28 : Symbol(T28, Decl(variadicTuples1.ts, 249, 20)) ->Last : Symbol(Last, Decl(variadicTuples1.ts, 211, 102)) +>T28 : Symbol(T28, Decl(variadicTuples1.ts, 263, 20)) +>Last : Symbol(Last, Decl(variadicTuples1.ts, 225, 102)) type T29 = Last; ->T29 : Symbol(T29, Decl(variadicTuples1.ts, 250, 21)) ->Last : Symbol(Last, Decl(variadicTuples1.ts, 211, 102)) +>T29 : Symbol(T29, Decl(variadicTuples1.ts, 264, 21)) +>Last : Symbol(Last, Decl(variadicTuples1.ts, 225, 102)) type T30 = DropLast<[number, symbol, string]>; ->T30 : Symbol(T30, Decl(variadicTuples1.ts, 251, 23)) ->DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 216, 26)) +>T30 : Symbol(T30, Decl(variadicTuples1.ts, 265, 23)) +>DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 230, 26)) type T31 = DropLast<[symbol, string]>; ->T31 : Symbol(T31, Decl(variadicTuples1.ts, 253, 46)) ->DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 216, 26)) +>T31 : Symbol(T31, Decl(variadicTuples1.ts, 267, 46)) +>DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 230, 26)) type T32 = DropLast<[string]>; ->T32 : Symbol(T32, Decl(variadicTuples1.ts, 254, 38)) ->DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 216, 26)) +>T32 : Symbol(T32, Decl(variadicTuples1.ts, 268, 38)) +>DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 230, 26)) type T33 = DropLast<[number, symbol, ...string[]]>; ->T33 : Symbol(T33, Decl(variadicTuples1.ts, 255, 30)) ->DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 216, 26)) +>T33 : Symbol(T33, Decl(variadicTuples1.ts, 269, 30)) +>DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 230, 26)) type T34 = DropLast<[symbol, ...string[]]>; ->T34 : Symbol(T34, Decl(variadicTuples1.ts, 256, 51)) ->DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 216, 26)) +>T34 : Symbol(T34, Decl(variadicTuples1.ts, 270, 51)) +>DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 230, 26)) type T35 = DropLast<[string?]>; ->T35 : Symbol(T35, Decl(variadicTuples1.ts, 257, 43)) ->DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 216, 26)) +>T35 : Symbol(T35, Decl(variadicTuples1.ts, 271, 43)) +>DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 230, 26)) type T36 = DropLast; ->T36 : Symbol(T36, Decl(variadicTuples1.ts, 258, 31)) ->DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 216, 26)) +>T36 : Symbol(T36, Decl(variadicTuples1.ts, 272, 31)) +>DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 230, 26)) type T37 = DropLast<[]>; // unknown[], maybe should be [] ->T37 : Symbol(T37, Decl(variadicTuples1.ts, 259, 30)) ->DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 216, 26)) +>T37 : Symbol(T37, Decl(variadicTuples1.ts, 273, 30)) +>DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 230, 26)) type T38 = DropLast; ->T38 : Symbol(T38, Decl(variadicTuples1.ts, 260, 24)) ->DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 216, 26)) +>T38 : Symbol(T38, Decl(variadicTuples1.ts, 274, 24)) +>DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 230, 26)) type T39 = DropLast; ->T39 : Symbol(T39, Decl(variadicTuples1.ts, 261, 25)) ->DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 216, 26)) +>T39 : Symbol(T39, Decl(variadicTuples1.ts, 275, 25)) +>DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 230, 26)) type R00 = First; ->R00 : Symbol(R00, Decl(variadicTuples1.ts, 262, 27)) ->First : Symbol(First, Decl(variadicTuples1.ts, 203, 1)) +>R00 : Symbol(R00, Decl(variadicTuples1.ts, 276, 27)) +>First : Symbol(First, Decl(variadicTuples1.ts, 217, 1)) type R01 = First; ->R01 : Symbol(R01, Decl(variadicTuples1.ts, 264, 52)) ->First : Symbol(First, Decl(variadicTuples1.ts, 203, 1)) +>R01 : Symbol(R01, Decl(variadicTuples1.ts, 278, 52)) +>First : Symbol(First, Decl(variadicTuples1.ts, 217, 1)) type R02 = First; ->R02 : Symbol(R02, Decl(variadicTuples1.ts, 265, 44)) ->First : Symbol(First, Decl(variadicTuples1.ts, 203, 1)) +>R02 : Symbol(R02, Decl(variadicTuples1.ts, 279, 44)) +>First : Symbol(First, Decl(variadicTuples1.ts, 217, 1)) type R03 = First; ->R03 : Symbol(R03, Decl(variadicTuples1.ts, 266, 36)) ->First : Symbol(First, Decl(variadicTuples1.ts, 203, 1)) +>R03 : Symbol(R03, Decl(variadicTuples1.ts, 280, 36)) +>First : Symbol(First, Decl(variadicTuples1.ts, 217, 1)) type R04 = First; ->R04 : Symbol(R04, Decl(variadicTuples1.ts, 267, 57)) ->First : Symbol(First, Decl(variadicTuples1.ts, 203, 1)) +>R04 : Symbol(R04, Decl(variadicTuples1.ts, 281, 57)) +>First : Symbol(First, Decl(variadicTuples1.ts, 217, 1)) type R05 = First; ->R05 : Symbol(R05, Decl(variadicTuples1.ts, 268, 49)) ->First : Symbol(First, Decl(variadicTuples1.ts, 203, 1)) +>R05 : Symbol(R05, Decl(variadicTuples1.ts, 282, 49)) +>First : Symbol(First, Decl(variadicTuples1.ts, 217, 1)) type R06 = First; ->R06 : Symbol(R06, Decl(variadicTuples1.ts, 269, 36)) ->First : Symbol(First, Decl(variadicTuples1.ts, 203, 1)) +>R06 : Symbol(R06, Decl(variadicTuples1.ts, 283, 36)) +>First : Symbol(First, Decl(variadicTuples1.ts, 217, 1)) type R10 = DropFirst; ->R10 : Symbol(R10, Decl(variadicTuples1.ts, 270, 30)) ->DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 209, 21)) +>R10 : Symbol(R10, Decl(variadicTuples1.ts, 284, 30)) +>DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 223, 21)) type R11 = DropFirst; ->R11 : Symbol(R11, Decl(variadicTuples1.ts, 272, 56)) ->DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 209, 21)) +>R11 : Symbol(R11, Decl(variadicTuples1.ts, 286, 56)) +>DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 223, 21)) type R12 = DropFirst; ->R12 : Symbol(R12, Decl(variadicTuples1.ts, 273, 48)) ->DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 209, 21)) +>R12 : Symbol(R12, Decl(variadicTuples1.ts, 287, 48)) +>DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 223, 21)) type R13 = DropFirst; ->R13 : Symbol(R13, Decl(variadicTuples1.ts, 274, 40)) ->DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 209, 21)) +>R13 : Symbol(R13, Decl(variadicTuples1.ts, 288, 40)) +>DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 223, 21)) type R14 = DropFirst; ->R14 : Symbol(R14, Decl(variadicTuples1.ts, 275, 61)) ->DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 209, 21)) +>R14 : Symbol(R14, Decl(variadicTuples1.ts, 289, 61)) +>DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 223, 21)) type R15 = DropFirst; ->R15 : Symbol(R15, Decl(variadicTuples1.ts, 276, 53)) ->DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 209, 21)) +>R15 : Symbol(R15, Decl(variadicTuples1.ts, 290, 53)) +>DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 223, 21)) type R16 = DropFirst; ->R16 : Symbol(R16, Decl(variadicTuples1.ts, 277, 40)) ->DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 209, 21)) +>R16 : Symbol(R16, Decl(variadicTuples1.ts, 291, 40)) +>DropFirst : Symbol(DropFirst, Decl(variadicTuples1.ts, 223, 21)) type R20 = Last; ->R20 : Symbol(R20, Decl(variadicTuples1.ts, 278, 34)) ->Last : Symbol(Last, Decl(variadicTuples1.ts, 211, 102)) +>R20 : Symbol(R20, Decl(variadicTuples1.ts, 292, 34)) +>Last : Symbol(Last, Decl(variadicTuples1.ts, 225, 102)) type R21 = Last; ->R21 : Symbol(R21, Decl(variadicTuples1.ts, 280, 51)) ->Last : Symbol(Last, Decl(variadicTuples1.ts, 211, 102)) +>R21 : Symbol(R21, Decl(variadicTuples1.ts, 294, 51)) +>Last : Symbol(Last, Decl(variadicTuples1.ts, 225, 102)) type R22 = Last; ->R22 : Symbol(R22, Decl(variadicTuples1.ts, 281, 43)) ->Last : Symbol(Last, Decl(variadicTuples1.ts, 211, 102)) +>R22 : Symbol(R22, Decl(variadicTuples1.ts, 295, 43)) +>Last : Symbol(Last, Decl(variadicTuples1.ts, 225, 102)) type R23 = Last; ->R23 : Symbol(R23, Decl(variadicTuples1.ts, 282, 35)) ->Last : Symbol(Last, Decl(variadicTuples1.ts, 211, 102)) +>R23 : Symbol(R23, Decl(variadicTuples1.ts, 296, 35)) +>Last : Symbol(Last, Decl(variadicTuples1.ts, 225, 102)) type R24 = Last; ->R24 : Symbol(R24, Decl(variadicTuples1.ts, 283, 56)) ->Last : Symbol(Last, Decl(variadicTuples1.ts, 211, 102)) +>R24 : Symbol(R24, Decl(variadicTuples1.ts, 297, 56)) +>Last : Symbol(Last, Decl(variadicTuples1.ts, 225, 102)) type R25 = Last; ->R25 : Symbol(R25, Decl(variadicTuples1.ts, 284, 48)) ->Last : Symbol(Last, Decl(variadicTuples1.ts, 211, 102)) +>R25 : Symbol(R25, Decl(variadicTuples1.ts, 298, 48)) +>Last : Symbol(Last, Decl(variadicTuples1.ts, 225, 102)) type R26 = Last; ->R26 : Symbol(R26, Decl(variadicTuples1.ts, 285, 35)) ->Last : Symbol(Last, Decl(variadicTuples1.ts, 211, 102)) +>R26 : Symbol(R26, Decl(variadicTuples1.ts, 299, 35)) +>Last : Symbol(Last, Decl(variadicTuples1.ts, 225, 102)) type R30 = DropLast; ->R30 : Symbol(R30, Decl(variadicTuples1.ts, 286, 29)) ->DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 216, 26)) +>R30 : Symbol(R30, Decl(variadicTuples1.ts, 300, 29)) +>DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 230, 26)) type R31 = DropLast; ->R31 : Symbol(R31, Decl(variadicTuples1.ts, 288, 55)) ->DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 216, 26)) +>R31 : Symbol(R31, Decl(variadicTuples1.ts, 302, 55)) +>DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 230, 26)) type R32 = DropLast; ->R32 : Symbol(R32, Decl(variadicTuples1.ts, 289, 47)) ->DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 216, 26)) +>R32 : Symbol(R32, Decl(variadicTuples1.ts, 303, 47)) +>DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 230, 26)) type R33 = DropLast; ->R33 : Symbol(R33, Decl(variadicTuples1.ts, 290, 39)) ->DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 216, 26)) +>R33 : Symbol(R33, Decl(variadicTuples1.ts, 304, 39)) +>DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 230, 26)) type R34 = DropLast; ->R34 : Symbol(R34, Decl(variadicTuples1.ts, 291, 60)) ->DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 216, 26)) +>R34 : Symbol(R34, Decl(variadicTuples1.ts, 305, 60)) +>DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 230, 26)) type R35 = DropLast; ->R35 : Symbol(R35, Decl(variadicTuples1.ts, 292, 52)) ->DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 216, 26)) +>R35 : Symbol(R35, Decl(variadicTuples1.ts, 306, 52)) +>DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 230, 26)) type R36 = DropLast; ->R36 : Symbol(R36, Decl(variadicTuples1.ts, 293, 39)) ->DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 216, 26)) +>R36 : Symbol(R36, Decl(variadicTuples1.ts, 307, 39)) +>DropLast : Symbol(DropLast, Decl(variadicTuples1.ts, 230, 26)) // Inference to [...T, ...U] with implied arity for T function curry(f: (...args: [...T, ...U]) => R, ...a: T) { ->curry : Symbol(curry, Decl(variadicTuples1.ts, 294, 33)) ->T : Symbol(T, Decl(variadicTuples1.ts, 298, 15)) ->U : Symbol(U, Decl(variadicTuples1.ts, 298, 35)) ->R : Symbol(R, Decl(variadicTuples1.ts, 298, 56)) ->f : Symbol(f, Decl(variadicTuples1.ts, 298, 60)) ->args : Symbol(args, Decl(variadicTuples1.ts, 298, 64)) ->T : Symbol(T, Decl(variadicTuples1.ts, 298, 15)) ->U : Symbol(U, Decl(variadicTuples1.ts, 298, 35)) ->R : Symbol(R, Decl(variadicTuples1.ts, 298, 56)) ->a : Symbol(a, Decl(variadicTuples1.ts, 298, 92)) ->T : Symbol(T, Decl(variadicTuples1.ts, 298, 15)) +>curry : Symbol(curry, Decl(variadicTuples1.ts, 308, 33)) +>T : Symbol(T, Decl(variadicTuples1.ts, 312, 15)) +>U : Symbol(U, Decl(variadicTuples1.ts, 312, 35)) +>R : Symbol(R, Decl(variadicTuples1.ts, 312, 56)) +>f : Symbol(f, Decl(variadicTuples1.ts, 312, 60)) +>args : Symbol(args, Decl(variadicTuples1.ts, 312, 64)) +>T : Symbol(T, Decl(variadicTuples1.ts, 312, 15)) +>U : Symbol(U, Decl(variadicTuples1.ts, 312, 35)) +>R : Symbol(R, Decl(variadicTuples1.ts, 312, 56)) +>a : Symbol(a, Decl(variadicTuples1.ts, 312, 92)) +>T : Symbol(T, Decl(variadicTuples1.ts, 312, 15)) return (...b: U) => f(...a, ...b); ->b : Symbol(b, Decl(variadicTuples1.ts, 299, 12)) ->U : Symbol(U, Decl(variadicTuples1.ts, 298, 35)) ->f : Symbol(f, Decl(variadicTuples1.ts, 298, 60)) ->a : Symbol(a, Decl(variadicTuples1.ts, 298, 92)) ->b : Symbol(b, Decl(variadicTuples1.ts, 299, 12)) +>b : Symbol(b, Decl(variadicTuples1.ts, 313, 12)) +>U : Symbol(U, Decl(variadicTuples1.ts, 312, 35)) +>f : Symbol(f, Decl(variadicTuples1.ts, 312, 60)) +>a : Symbol(a, Decl(variadicTuples1.ts, 312, 92)) +>b : Symbol(b, Decl(variadicTuples1.ts, 313, 12)) } const fn1 = (a: number, b: string, c: boolean, d: string[]) => 0; ->fn1 : Symbol(fn1, Decl(variadicTuples1.ts, 302, 5)) ->a : Symbol(a, Decl(variadicTuples1.ts, 302, 13)) ->b : Symbol(b, Decl(variadicTuples1.ts, 302, 23)) ->c : Symbol(c, Decl(variadicTuples1.ts, 302, 34)) ->d : Symbol(d, Decl(variadicTuples1.ts, 302, 46)) +>fn1 : Symbol(fn1, Decl(variadicTuples1.ts, 316, 5)) +>a : Symbol(a, Decl(variadicTuples1.ts, 316, 13)) +>b : Symbol(b, Decl(variadicTuples1.ts, 316, 23)) +>c : Symbol(c, Decl(variadicTuples1.ts, 316, 34)) +>d : Symbol(d, Decl(variadicTuples1.ts, 316, 46)) const c0 = curry(fn1); // (a: number, b: string, c: boolean, d: string[]) => number ->c0 : Symbol(c0, Decl(variadicTuples1.ts, 304, 5)) ->curry : Symbol(curry, Decl(variadicTuples1.ts, 294, 33)) ->fn1 : Symbol(fn1, Decl(variadicTuples1.ts, 302, 5)) +>c0 : Symbol(c0, Decl(variadicTuples1.ts, 318, 5)) +>curry : Symbol(curry, Decl(variadicTuples1.ts, 308, 33)) +>fn1 : Symbol(fn1, Decl(variadicTuples1.ts, 316, 5)) const c1 = curry(fn1, 1); // (b: string, c: boolean, d: string[]) => number ->c1 : Symbol(c1, Decl(variadicTuples1.ts, 305, 5)) ->curry : Symbol(curry, Decl(variadicTuples1.ts, 294, 33)) ->fn1 : Symbol(fn1, Decl(variadicTuples1.ts, 302, 5)) +>c1 : Symbol(c1, Decl(variadicTuples1.ts, 319, 5)) +>curry : Symbol(curry, Decl(variadicTuples1.ts, 308, 33)) +>fn1 : Symbol(fn1, Decl(variadicTuples1.ts, 316, 5)) const c2 = curry(fn1, 1, 'abc'); // (c: boolean, d: string[]) => number ->c2 : Symbol(c2, Decl(variadicTuples1.ts, 306, 5)) ->curry : Symbol(curry, Decl(variadicTuples1.ts, 294, 33)) ->fn1 : Symbol(fn1, Decl(variadicTuples1.ts, 302, 5)) +>c2 : Symbol(c2, Decl(variadicTuples1.ts, 320, 5)) +>curry : Symbol(curry, Decl(variadicTuples1.ts, 308, 33)) +>fn1 : Symbol(fn1, Decl(variadicTuples1.ts, 316, 5)) const c3 = curry(fn1, 1, 'abc', true); // (d: string[]) => number ->c3 : Symbol(c3, Decl(variadicTuples1.ts, 307, 5)) ->curry : Symbol(curry, Decl(variadicTuples1.ts, 294, 33)) ->fn1 : Symbol(fn1, Decl(variadicTuples1.ts, 302, 5)) +>c3 : Symbol(c3, Decl(variadicTuples1.ts, 321, 5)) +>curry : Symbol(curry, Decl(variadicTuples1.ts, 308, 33)) +>fn1 : Symbol(fn1, Decl(variadicTuples1.ts, 316, 5)) const c4 = curry(fn1, 1, 'abc', true, ['x', 'y']); // () => number ->c4 : Symbol(c4, Decl(variadicTuples1.ts, 308, 5)) ->curry : Symbol(curry, Decl(variadicTuples1.ts, 294, 33)) ->fn1 : Symbol(fn1, Decl(variadicTuples1.ts, 302, 5)) +>c4 : Symbol(c4, Decl(variadicTuples1.ts, 322, 5)) +>curry : Symbol(curry, Decl(variadicTuples1.ts, 308, 33)) +>fn1 : Symbol(fn1, Decl(variadicTuples1.ts, 316, 5)) const fn2 = (x: number, b: boolean, ...args: string[]) => 0; ->fn2 : Symbol(fn2, Decl(variadicTuples1.ts, 310, 5)) ->x : Symbol(x, Decl(variadicTuples1.ts, 310, 13)) ->b : Symbol(b, Decl(variadicTuples1.ts, 310, 23)) ->args : Symbol(args, Decl(variadicTuples1.ts, 310, 35)) +>fn2 : Symbol(fn2, Decl(variadicTuples1.ts, 324, 5)) +>x : Symbol(x, Decl(variadicTuples1.ts, 324, 13)) +>b : Symbol(b, Decl(variadicTuples1.ts, 324, 23)) +>args : Symbol(args, Decl(variadicTuples1.ts, 324, 35)) const c10 = curry(fn2); // (x: number, b: boolean, ...args: string[]) => number ->c10 : Symbol(c10, Decl(variadicTuples1.ts, 312, 5)) ->curry : Symbol(curry, Decl(variadicTuples1.ts, 294, 33)) ->fn2 : Symbol(fn2, Decl(variadicTuples1.ts, 310, 5)) +>c10 : Symbol(c10, Decl(variadicTuples1.ts, 326, 5)) +>curry : Symbol(curry, Decl(variadicTuples1.ts, 308, 33)) +>fn2 : Symbol(fn2, Decl(variadicTuples1.ts, 324, 5)) const c11 = curry(fn2, 1); // (b: boolean, ...args: string[]) => number ->c11 : Symbol(c11, Decl(variadicTuples1.ts, 313, 5)) ->curry : Symbol(curry, Decl(variadicTuples1.ts, 294, 33)) ->fn2 : Symbol(fn2, Decl(variadicTuples1.ts, 310, 5)) +>c11 : Symbol(c11, Decl(variadicTuples1.ts, 327, 5)) +>curry : Symbol(curry, Decl(variadicTuples1.ts, 308, 33)) +>fn2 : Symbol(fn2, Decl(variadicTuples1.ts, 324, 5)) const c12 = curry(fn2, 1, true); // (...args: string[]) => number ->c12 : Symbol(c12, Decl(variadicTuples1.ts, 314, 5)) ->curry : Symbol(curry, Decl(variadicTuples1.ts, 294, 33)) ->fn2 : Symbol(fn2, Decl(variadicTuples1.ts, 310, 5)) +>c12 : Symbol(c12, Decl(variadicTuples1.ts, 328, 5)) +>curry : Symbol(curry, Decl(variadicTuples1.ts, 308, 33)) +>fn2 : Symbol(fn2, Decl(variadicTuples1.ts, 324, 5)) const c13 = curry(fn2, 1, true, 'abc', 'def'); // (...args: string[]) => number ->c13 : Symbol(c13, Decl(variadicTuples1.ts, 315, 5)) ->curry : Symbol(curry, Decl(variadicTuples1.ts, 294, 33)) ->fn2 : Symbol(fn2, Decl(variadicTuples1.ts, 310, 5)) +>c13 : Symbol(c13, Decl(variadicTuples1.ts, 329, 5)) +>curry : Symbol(curry, Decl(variadicTuples1.ts, 308, 33)) +>fn2 : Symbol(fn2, Decl(variadicTuples1.ts, 324, 5)) const fn3 = (...args: string[]) => 0; ->fn3 : Symbol(fn3, Decl(variadicTuples1.ts, 317, 5)) ->args : Symbol(args, Decl(variadicTuples1.ts, 317, 13)) +>fn3 : Symbol(fn3, Decl(variadicTuples1.ts, 331, 5)) +>args : Symbol(args, Decl(variadicTuples1.ts, 331, 13)) const c20 = curry(fn3); // (...args: string[]) => number ->c20 : Symbol(c20, Decl(variadicTuples1.ts, 319, 5)) ->curry : Symbol(curry, Decl(variadicTuples1.ts, 294, 33)) ->fn3 : Symbol(fn3, Decl(variadicTuples1.ts, 317, 5)) +>c20 : Symbol(c20, Decl(variadicTuples1.ts, 333, 5)) +>curry : Symbol(curry, Decl(variadicTuples1.ts, 308, 33)) +>fn3 : Symbol(fn3, Decl(variadicTuples1.ts, 331, 5)) const c21 = curry(fn3, 'abc', 'def'); // (...args: string[]) => number ->c21 : Symbol(c21, Decl(variadicTuples1.ts, 320, 5)) ->curry : Symbol(curry, Decl(variadicTuples1.ts, 294, 33)) ->fn3 : Symbol(fn3, Decl(variadicTuples1.ts, 317, 5)) +>c21 : Symbol(c21, Decl(variadicTuples1.ts, 334, 5)) +>curry : Symbol(curry, Decl(variadicTuples1.ts, 308, 33)) +>fn3 : Symbol(fn3, Decl(variadicTuples1.ts, 331, 5)) const c22 = curry(fn3, ...sa); // (...args: string[]) => number ->c22 : Symbol(c22, Decl(variadicTuples1.ts, 321, 5)) ->curry : Symbol(curry, Decl(variadicTuples1.ts, 294, 33)) ->fn3 : Symbol(fn3, Decl(variadicTuples1.ts, 317, 5)) +>c22 : Symbol(c22, Decl(variadicTuples1.ts, 335, 5)) +>curry : Symbol(curry, Decl(variadicTuples1.ts, 308, 33)) +>fn3 : Symbol(fn3, Decl(variadicTuples1.ts, 331, 5)) >sa : Symbol(sa, Decl(variadicTuples1.ts, 29, 13)) // No inference to [...T, ...U] when there is no implied arity function curry2(f: (...args: [...T, ...U]) => R, t: [...T], u: [...U]) { ->curry2 : Symbol(curry2, Decl(variadicTuples1.ts, 321, 30)) ->T : Symbol(T, Decl(variadicTuples1.ts, 325, 16)) ->U : Symbol(U, Decl(variadicTuples1.ts, 325, 36)) ->R : Symbol(R, Decl(variadicTuples1.ts, 325, 57)) ->f : Symbol(f, Decl(variadicTuples1.ts, 325, 61)) ->args : Symbol(args, Decl(variadicTuples1.ts, 325, 65)) ->T : Symbol(T, Decl(variadicTuples1.ts, 325, 16)) ->U : Symbol(U, Decl(variadicTuples1.ts, 325, 36)) ->R : Symbol(R, Decl(variadicTuples1.ts, 325, 57)) ->t : Symbol(t, Decl(variadicTuples1.ts, 325, 93)) ->T : Symbol(T, Decl(variadicTuples1.ts, 325, 16)) ->u : Symbol(u, Decl(variadicTuples1.ts, 325, 104)) ->U : Symbol(U, Decl(variadicTuples1.ts, 325, 36)) +>curry2 : Symbol(curry2, Decl(variadicTuples1.ts, 335, 30)) +>T : Symbol(T, Decl(variadicTuples1.ts, 339, 16)) +>U : Symbol(U, Decl(variadicTuples1.ts, 339, 36)) +>R : Symbol(R, Decl(variadicTuples1.ts, 339, 57)) +>f : Symbol(f, Decl(variadicTuples1.ts, 339, 61)) +>args : Symbol(args, Decl(variadicTuples1.ts, 339, 65)) +>T : Symbol(T, Decl(variadicTuples1.ts, 339, 16)) +>U : Symbol(U, Decl(variadicTuples1.ts, 339, 36)) +>R : Symbol(R, Decl(variadicTuples1.ts, 339, 57)) +>t : Symbol(t, Decl(variadicTuples1.ts, 339, 93)) +>T : Symbol(T, Decl(variadicTuples1.ts, 339, 16)) +>u : Symbol(u, Decl(variadicTuples1.ts, 339, 104)) +>U : Symbol(U, Decl(variadicTuples1.ts, 339, 36)) return f(...t, ...u); ->f : Symbol(f, Decl(variadicTuples1.ts, 325, 61)) ->t : Symbol(t, Decl(variadicTuples1.ts, 325, 93)) ->u : Symbol(u, Decl(variadicTuples1.ts, 325, 104)) +>f : Symbol(f, Decl(variadicTuples1.ts, 339, 61)) +>t : Symbol(t, Decl(variadicTuples1.ts, 339, 93)) +>u : Symbol(u, Decl(variadicTuples1.ts, 339, 104)) } declare function fn10(a: string, b: number, c: boolean): string[]; ->fn10 : Symbol(fn10, Decl(variadicTuples1.ts, 327, 1)) ->a : Symbol(a, Decl(variadicTuples1.ts, 329, 22)) ->b : Symbol(b, Decl(variadicTuples1.ts, 329, 32)) ->c : Symbol(c, Decl(variadicTuples1.ts, 329, 43)) +>fn10 : Symbol(fn10, Decl(variadicTuples1.ts, 341, 1)) +>a : Symbol(a, Decl(variadicTuples1.ts, 343, 22)) +>b : Symbol(b, Decl(variadicTuples1.ts, 343, 32)) +>c : Symbol(c, Decl(variadicTuples1.ts, 343, 43)) curry2(fn10, ['hello', 42], [true]); ->curry2 : Symbol(curry2, Decl(variadicTuples1.ts, 321, 30)) ->fn10 : Symbol(fn10, Decl(variadicTuples1.ts, 327, 1)) +>curry2 : Symbol(curry2, Decl(variadicTuples1.ts, 335, 30)) +>fn10 : Symbol(fn10, Decl(variadicTuples1.ts, 341, 1)) curry2(fn10, ['hello'], [42, true]); ->curry2 : Symbol(curry2, Decl(variadicTuples1.ts, 321, 30)) ->fn10 : Symbol(fn10, Decl(variadicTuples1.ts, 327, 1)) +>curry2 : Symbol(curry2, Decl(variadicTuples1.ts, 335, 30)) +>fn10 : Symbol(fn10, Decl(variadicTuples1.ts, 341, 1)) // Inference to [...T] has higher priority than inference to [...T, number?] declare function ft(t1: [...T], t2: [...T, number?]): T; ->ft : Symbol(ft, Decl(variadicTuples1.ts, 332, 36)) ->T : Symbol(T, Decl(variadicTuples1.ts, 336, 20)) ->t1 : Symbol(t1, Decl(variadicTuples1.ts, 336, 41)) ->T : Symbol(T, Decl(variadicTuples1.ts, 336, 20)) ->t2 : Symbol(t2, Decl(variadicTuples1.ts, 336, 52)) ->T : Symbol(T, Decl(variadicTuples1.ts, 336, 20)) ->T : Symbol(T, Decl(variadicTuples1.ts, 336, 20)) +>ft : Symbol(ft, Decl(variadicTuples1.ts, 346, 36)) +>T : Symbol(T, Decl(variadicTuples1.ts, 350, 20)) +>t1 : Symbol(t1, Decl(variadicTuples1.ts, 350, 41)) +>T : Symbol(T, Decl(variadicTuples1.ts, 350, 20)) +>t2 : Symbol(t2, Decl(variadicTuples1.ts, 350, 52)) +>T : Symbol(T, Decl(variadicTuples1.ts, 350, 20)) +>T : Symbol(T, Decl(variadicTuples1.ts, 350, 20)) ft([1, 2, 3], [1, 2, 3]); ->ft : Symbol(ft, Decl(variadicTuples1.ts, 332, 36)) +>ft : Symbol(ft, Decl(variadicTuples1.ts, 346, 36)) ft([1, 2], [1, 2, 3]); ->ft : Symbol(ft, Decl(variadicTuples1.ts, 332, 36)) +>ft : Symbol(ft, Decl(variadicTuples1.ts, 346, 36)) ft(['a', 'b'], ['c', 'd']) ->ft : Symbol(ft, Decl(variadicTuples1.ts, 332, 36)) +>ft : Symbol(ft, Decl(variadicTuples1.ts, 346, 36)) ft(['a', 'b'], ['c', 'd', 42]) ->ft : Symbol(ft, Decl(variadicTuples1.ts, 332, 36)) +>ft : Symbol(ft, Decl(variadicTuples1.ts, 346, 36)) // Last argument is contextually typed declare function call(...args: [...T, (...args: T) => R]): [T, R]; ->call : Symbol(call, Decl(variadicTuples1.ts, 341, 30)) ->T : Symbol(T, Decl(variadicTuples1.ts, 345, 22)) ->R : Symbol(R, Decl(variadicTuples1.ts, 345, 42)) ->args : Symbol(args, Decl(variadicTuples1.ts, 345, 46)) ->T : Symbol(T, Decl(variadicTuples1.ts, 345, 22)) ->args : Symbol(args, Decl(variadicTuples1.ts, 345, 63)) ->T : Symbol(T, Decl(variadicTuples1.ts, 345, 22)) ->R : Symbol(R, Decl(variadicTuples1.ts, 345, 42)) ->T : Symbol(T, Decl(variadicTuples1.ts, 345, 22)) ->R : Symbol(R, Decl(variadicTuples1.ts, 345, 42)) +>call : Symbol(call, Decl(variadicTuples1.ts, 355, 30)) +>T : Symbol(T, Decl(variadicTuples1.ts, 359, 22)) +>R : Symbol(R, Decl(variadicTuples1.ts, 359, 42)) +>args : Symbol(args, Decl(variadicTuples1.ts, 359, 46)) +>T : Symbol(T, Decl(variadicTuples1.ts, 359, 22)) +>args : Symbol(args, Decl(variadicTuples1.ts, 359, 63)) +>T : Symbol(T, Decl(variadicTuples1.ts, 359, 22)) +>R : Symbol(R, Decl(variadicTuples1.ts, 359, 42)) +>T : Symbol(T, Decl(variadicTuples1.ts, 359, 22)) +>R : Symbol(R, Decl(variadicTuples1.ts, 359, 42)) call('hello', 32, (a, b) => 42); ->call : Symbol(call, Decl(variadicTuples1.ts, 341, 30)) ->a : Symbol(a, Decl(variadicTuples1.ts, 347, 19)) ->b : Symbol(b, Decl(variadicTuples1.ts, 347, 21)) +>call : Symbol(call, Decl(variadicTuples1.ts, 355, 30)) +>a : Symbol(a, Decl(variadicTuples1.ts, 361, 19)) +>b : Symbol(b, Decl(variadicTuples1.ts, 361, 21)) call(...sa, (...x) => 42); ->call : Symbol(call, Decl(variadicTuples1.ts, 341, 30)) +>call : Symbol(call, Decl(variadicTuples1.ts, 355, 30)) >sa : Symbol(sa, Decl(variadicTuples1.ts, 29, 13)) ->x : Symbol(x, Decl(variadicTuples1.ts, 348, 13)) +>x : Symbol(x, Decl(variadicTuples1.ts, 362, 13)) // No inference to ending optional elements (except with identical structure) declare function f20(args: [...T, number?]): T; ->f20 : Symbol(f20, Decl(variadicTuples1.ts, 348, 26)) ->T : Symbol(T, Decl(variadicTuples1.ts, 352, 21)) ->args : Symbol(args, Decl(variadicTuples1.ts, 352, 47)) ->T : Symbol(T, Decl(variadicTuples1.ts, 352, 21)) ->T : Symbol(T, Decl(variadicTuples1.ts, 352, 21)) +>f20 : Symbol(f20, Decl(variadicTuples1.ts, 362, 26)) +>T : Symbol(T, Decl(variadicTuples1.ts, 366, 21)) +>args : Symbol(args, Decl(variadicTuples1.ts, 366, 47)) +>T : Symbol(T, Decl(variadicTuples1.ts, 366, 21)) +>T : Symbol(T, Decl(variadicTuples1.ts, 366, 21)) function f21(args: [...U, number?]) { ->f21 : Symbol(f21, Decl(variadicTuples1.ts, 352, 73)) ->U : Symbol(U, Decl(variadicTuples1.ts, 354, 13)) ->args : Symbol(args, Decl(variadicTuples1.ts, 354, 33)) ->U : Symbol(U, Decl(variadicTuples1.ts, 354, 13)) +>f21 : Symbol(f21, Decl(variadicTuples1.ts, 366, 73)) +>U : Symbol(U, Decl(variadicTuples1.ts, 368, 13)) +>args : Symbol(args, Decl(variadicTuples1.ts, 368, 33)) +>U : Symbol(U, Decl(variadicTuples1.ts, 368, 13)) let v1 = f20(args); // U ->v1 : Symbol(v1, Decl(variadicTuples1.ts, 355, 7)) ->f20 : Symbol(f20, Decl(variadicTuples1.ts, 348, 26)) ->args : Symbol(args, Decl(variadicTuples1.ts, 354, 33)) +>v1 : Symbol(v1, Decl(variadicTuples1.ts, 369, 7)) +>f20 : Symbol(f20, Decl(variadicTuples1.ts, 362, 26)) +>args : Symbol(args, Decl(variadicTuples1.ts, 368, 33)) let v2 = f20(["foo", "bar"]); // [string] ->v2 : Symbol(v2, Decl(variadicTuples1.ts, 356, 7)) ->f20 : Symbol(f20, Decl(variadicTuples1.ts, 348, 26)) +>v2 : Symbol(v2, Decl(variadicTuples1.ts, 370, 7)) +>f20 : Symbol(f20, Decl(variadicTuples1.ts, 362, 26)) let v3 = f20(["foo", 42]); // [string] ->v3 : Symbol(v3, Decl(variadicTuples1.ts, 357, 7)) ->f20 : Symbol(f20, Decl(variadicTuples1.ts, 348, 26)) +>v3 : Symbol(v3, Decl(variadicTuples1.ts, 371, 7)) +>f20 : Symbol(f20, Decl(variadicTuples1.ts, 362, 26)) } declare function f22(args: [...T, number]): T; ->f22 : Symbol(f22, Decl(variadicTuples1.ts, 358, 1), Decl(variadicTuples1.ts, 360, 72)) ->T : Symbol(T, Decl(variadicTuples1.ts, 360, 21)) ->args : Symbol(args, Decl(variadicTuples1.ts, 360, 47)) ->T : Symbol(T, Decl(variadicTuples1.ts, 360, 21)) ->T : Symbol(T, Decl(variadicTuples1.ts, 360, 21)) +>f22 : Symbol(f22, Decl(variadicTuples1.ts, 372, 1), Decl(variadicTuples1.ts, 374, 72)) +>T : Symbol(T, Decl(variadicTuples1.ts, 374, 21)) +>args : Symbol(args, Decl(variadicTuples1.ts, 374, 47)) +>T : Symbol(T, Decl(variadicTuples1.ts, 374, 21)) +>T : Symbol(T, Decl(variadicTuples1.ts, 374, 21)) declare function f22(args: [...T]): T; ->f22 : Symbol(f22, Decl(variadicTuples1.ts, 358, 1), Decl(variadicTuples1.ts, 360, 72)) ->T : Symbol(T, Decl(variadicTuples1.ts, 361, 21)) ->args : Symbol(args, Decl(variadicTuples1.ts, 361, 47)) ->T : Symbol(T, Decl(variadicTuples1.ts, 361, 21)) ->T : Symbol(T, Decl(variadicTuples1.ts, 361, 21)) +>f22 : Symbol(f22, Decl(variadicTuples1.ts, 372, 1), Decl(variadicTuples1.ts, 374, 72)) +>T : Symbol(T, Decl(variadicTuples1.ts, 375, 21)) +>args : Symbol(args, Decl(variadicTuples1.ts, 375, 47)) +>T : Symbol(T, Decl(variadicTuples1.ts, 375, 21)) +>T : Symbol(T, Decl(variadicTuples1.ts, 375, 21)) function f23(args: [...U, number]) { ->f23 : Symbol(f23, Decl(variadicTuples1.ts, 361, 64)) ->U : Symbol(U, Decl(variadicTuples1.ts, 363, 13)) ->args : Symbol(args, Decl(variadicTuples1.ts, 363, 33)) ->U : Symbol(U, Decl(variadicTuples1.ts, 363, 13)) +>f23 : Symbol(f23, Decl(variadicTuples1.ts, 375, 64)) +>U : Symbol(U, Decl(variadicTuples1.ts, 377, 13)) +>args : Symbol(args, Decl(variadicTuples1.ts, 377, 33)) +>U : Symbol(U, Decl(variadicTuples1.ts, 377, 13)) let v1 = f22(args); // U ->v1 : Symbol(v1, Decl(variadicTuples1.ts, 364, 7)) ->f22 : Symbol(f22, Decl(variadicTuples1.ts, 358, 1), Decl(variadicTuples1.ts, 360, 72)) ->args : Symbol(args, Decl(variadicTuples1.ts, 363, 33)) +>v1 : Symbol(v1, Decl(variadicTuples1.ts, 378, 7)) +>f22 : Symbol(f22, Decl(variadicTuples1.ts, 372, 1), Decl(variadicTuples1.ts, 374, 72)) +>args : Symbol(args, Decl(variadicTuples1.ts, 377, 33)) let v2 = f22(["foo", "bar"]); // [string, string] ->v2 : Symbol(v2, Decl(variadicTuples1.ts, 365, 7)) ->f22 : Symbol(f22, Decl(variadicTuples1.ts, 358, 1), Decl(variadicTuples1.ts, 360, 72)) +>v2 : Symbol(v2, Decl(variadicTuples1.ts, 379, 7)) +>f22 : Symbol(f22, Decl(variadicTuples1.ts, 372, 1), Decl(variadicTuples1.ts, 374, 72)) let v3 = f22(["foo", 42]); // [string] ->v3 : Symbol(v3, Decl(variadicTuples1.ts, 366, 7)) ->f22 : Symbol(f22, Decl(variadicTuples1.ts, 358, 1), Decl(variadicTuples1.ts, 360, 72)) +>v3 : Symbol(v3, Decl(variadicTuples1.ts, 380, 7)) +>f22 : Symbol(f22, Decl(variadicTuples1.ts, 372, 1), Decl(variadicTuples1.ts, 374, 72)) } // Repro from #39327 interface Desc { ->Desc : Symbol(Desc, Decl(variadicTuples1.ts, 367, 1)) ->A : Symbol(A, Decl(variadicTuples1.ts, 371, 15)) ->T : Symbol(T, Decl(variadicTuples1.ts, 371, 35)) +>Desc : Symbol(Desc, Decl(variadicTuples1.ts, 381, 1)) +>A : Symbol(A, Decl(variadicTuples1.ts, 385, 15)) +>T : Symbol(T, Decl(variadicTuples1.ts, 385, 35)) readonly f: (...args: A) => T; ->f : Symbol(Desc.f, Decl(variadicTuples1.ts, 371, 40)) ->args : Symbol(args, Decl(variadicTuples1.ts, 372, 17)) ->A : Symbol(A, Decl(variadicTuples1.ts, 371, 15)) ->T : Symbol(T, Decl(variadicTuples1.ts, 371, 35)) +>f : Symbol(Desc.f, Decl(variadicTuples1.ts, 385, 40)) +>args : Symbol(args, Decl(variadicTuples1.ts, 386, 17)) +>A : Symbol(A, Decl(variadicTuples1.ts, 385, 15)) +>T : Symbol(T, Decl(variadicTuples1.ts, 385, 35)) bind(this: Desc<[...T, ...U], R>, ...args: T): Desc<[...U], R>; ->bind : Symbol(Desc.bind, Decl(variadicTuples1.ts, 372, 34)) ->T : Symbol(T, Decl(variadicTuples1.ts, 373, 9)) ->U : Symbol(U, Decl(variadicTuples1.ts, 373, 29)) ->R : Symbol(R, Decl(variadicTuples1.ts, 373, 50)) ->this : Symbol(this, Decl(variadicTuples1.ts, 373, 54)) ->Desc : Symbol(Desc, Decl(variadicTuples1.ts, 367, 1)) ->T : Symbol(T, Decl(variadicTuples1.ts, 373, 9)) ->U : Symbol(U, Decl(variadicTuples1.ts, 373, 29)) ->R : Symbol(R, Decl(variadicTuples1.ts, 373, 50)) ->args : Symbol(args, Decl(variadicTuples1.ts, 373, 82)) ->T : Symbol(T, Decl(variadicTuples1.ts, 373, 9)) ->Desc : Symbol(Desc, Decl(variadicTuples1.ts, 367, 1)) ->U : Symbol(U, Decl(variadicTuples1.ts, 373, 29)) ->R : Symbol(R, Decl(variadicTuples1.ts, 373, 50)) +>bind : Symbol(Desc.bind, Decl(variadicTuples1.ts, 386, 34)) +>T : Symbol(T, Decl(variadicTuples1.ts, 387, 9)) +>U : Symbol(U, Decl(variadicTuples1.ts, 387, 29)) +>R : Symbol(R, Decl(variadicTuples1.ts, 387, 50)) +>this : Symbol(this, Decl(variadicTuples1.ts, 387, 54)) +>Desc : Symbol(Desc, Decl(variadicTuples1.ts, 381, 1)) +>T : Symbol(T, Decl(variadicTuples1.ts, 387, 9)) +>U : Symbol(U, Decl(variadicTuples1.ts, 387, 29)) +>R : Symbol(R, Decl(variadicTuples1.ts, 387, 50)) +>args : Symbol(args, Decl(variadicTuples1.ts, 387, 82)) +>T : Symbol(T, Decl(variadicTuples1.ts, 387, 9)) +>Desc : Symbol(Desc, Decl(variadicTuples1.ts, 381, 1)) +>U : Symbol(U, Decl(variadicTuples1.ts, 387, 29)) +>R : Symbol(R, Decl(variadicTuples1.ts, 387, 50)) } declare const a: Desc<[string, number, boolean], object>; ->a : Symbol(a, Decl(variadicTuples1.ts, 376, 13)) ->Desc : Symbol(Desc, Decl(variadicTuples1.ts, 367, 1)) +>a : Symbol(a, Decl(variadicTuples1.ts, 390, 13)) +>Desc : Symbol(Desc, Decl(variadicTuples1.ts, 381, 1)) const b = a.bind("", 1); // Desc<[boolean], object> ->b : Symbol(b, Decl(variadicTuples1.ts, 377, 5)) ->a.bind : Symbol(Desc.bind, Decl(variadicTuples1.ts, 372, 34)) ->a : Symbol(a, Decl(variadicTuples1.ts, 376, 13)) ->bind : Symbol(Desc.bind, Decl(variadicTuples1.ts, 372, 34)) +>b : Symbol(b, Decl(variadicTuples1.ts, 391, 5)) +>a.bind : Symbol(Desc.bind, Decl(variadicTuples1.ts, 386, 34)) +>a : Symbol(a, Decl(variadicTuples1.ts, 390, 13)) +>bind : Symbol(Desc.bind, Decl(variadicTuples1.ts, 386, 34)) // Repro from #39607 declare function getUser(id: string, options?: { x?: string }): string; ->getUser : Symbol(getUser, Decl(variadicTuples1.ts, 377, 24)) ->id : Symbol(id, Decl(variadicTuples1.ts, 381, 25)) ->options : Symbol(options, Decl(variadicTuples1.ts, 381, 36)) ->x : Symbol(x, Decl(variadicTuples1.ts, 381, 48)) +>getUser : Symbol(getUser, Decl(variadicTuples1.ts, 391, 24)) +>id : Symbol(id, Decl(variadicTuples1.ts, 395, 25)) +>options : Symbol(options, Decl(variadicTuples1.ts, 395, 36)) +>x : Symbol(x, Decl(variadicTuples1.ts, 395, 48)) declare function getOrgUser(id: string, orgId: number, options?: { y?: number, z?: boolean }): void; ->getOrgUser : Symbol(getOrgUser, Decl(variadicTuples1.ts, 381, 71)) ->id : Symbol(id, Decl(variadicTuples1.ts, 383, 28)) ->orgId : Symbol(orgId, Decl(variadicTuples1.ts, 383, 39)) ->options : Symbol(options, Decl(variadicTuples1.ts, 383, 54)) ->y : Symbol(y, Decl(variadicTuples1.ts, 383, 66)) ->z : Symbol(z, Decl(variadicTuples1.ts, 383, 78)) +>getOrgUser : Symbol(getOrgUser, Decl(variadicTuples1.ts, 395, 71)) +>id : Symbol(id, Decl(variadicTuples1.ts, 397, 28)) +>orgId : Symbol(orgId, Decl(variadicTuples1.ts, 397, 39)) +>options : Symbol(options, Decl(variadicTuples1.ts, 397, 54)) +>y : Symbol(y, Decl(variadicTuples1.ts, 397, 66)) +>z : Symbol(z, Decl(variadicTuples1.ts, 397, 78)) function callApi(method: (...args: [...T, object]) => U) { ->callApi : Symbol(callApi, Decl(variadicTuples1.ts, 383, 100)) ->T : Symbol(T, Decl(variadicTuples1.ts, 385, 17)) ->U : Symbol(U, Decl(variadicTuples1.ts, 385, 42)) ->method : Symbol(method, Decl(variadicTuples1.ts, 385, 53)) ->args : Symbol(args, Decl(variadicTuples1.ts, 385, 62)) ->T : Symbol(T, Decl(variadicTuples1.ts, 385, 17)) ->U : Symbol(U, Decl(variadicTuples1.ts, 385, 42)) +>callApi : Symbol(callApi, Decl(variadicTuples1.ts, 397, 100)) +>T : Symbol(T, Decl(variadicTuples1.ts, 399, 17)) +>U : Symbol(U, Decl(variadicTuples1.ts, 399, 42)) +>method : Symbol(method, Decl(variadicTuples1.ts, 399, 53)) +>args : Symbol(args, Decl(variadicTuples1.ts, 399, 62)) +>T : Symbol(T, Decl(variadicTuples1.ts, 399, 17)) +>U : Symbol(U, Decl(variadicTuples1.ts, 399, 42)) return (...args: [...T]) => method(...args, {}); ->args : Symbol(args, Decl(variadicTuples1.ts, 386, 12)) ->T : Symbol(T, Decl(variadicTuples1.ts, 385, 17)) ->method : Symbol(method, Decl(variadicTuples1.ts, 385, 53)) ->args : Symbol(args, Decl(variadicTuples1.ts, 386, 12)) +>args : Symbol(args, Decl(variadicTuples1.ts, 400, 12)) +>T : Symbol(T, Decl(variadicTuples1.ts, 399, 17)) +>method : Symbol(method, Decl(variadicTuples1.ts, 399, 53)) +>args : Symbol(args, Decl(variadicTuples1.ts, 400, 12)) } callApi(getUser); ->callApi : Symbol(callApi, Decl(variadicTuples1.ts, 383, 100)) ->getUser : Symbol(getUser, Decl(variadicTuples1.ts, 377, 24)) +>callApi : Symbol(callApi, Decl(variadicTuples1.ts, 397, 100)) +>getUser : Symbol(getUser, Decl(variadicTuples1.ts, 391, 24)) callApi(getOrgUser); ->callApi : Symbol(callApi, Decl(variadicTuples1.ts, 383, 100)) ->getOrgUser : Symbol(getOrgUser, Decl(variadicTuples1.ts, 381, 71)) +>callApi : Symbol(callApi, Decl(variadicTuples1.ts, 397, 100)) +>getOrgUser : Symbol(getOrgUser, Decl(variadicTuples1.ts, 395, 71)) // Repro from #40235 type Numbers = number[]; ->Numbers : Symbol(Numbers, Decl(variadicTuples1.ts, 390, 20)) +>Numbers : Symbol(Numbers, Decl(variadicTuples1.ts, 404, 20)) type Unbounded = [...Numbers, boolean]; ->Unbounded : Symbol(Unbounded, Decl(variadicTuples1.ts, 394, 24)) ->Numbers : Symbol(Numbers, Decl(variadicTuples1.ts, 390, 20)) +>Unbounded : Symbol(Unbounded, Decl(variadicTuples1.ts, 408, 24)) +>Numbers : Symbol(Numbers, Decl(variadicTuples1.ts, 404, 20)) const data: Unbounded = [false, false]; // Error ->data : Symbol(data, Decl(variadicTuples1.ts, 396, 5)) ->Unbounded : Symbol(Unbounded, Decl(variadicTuples1.ts, 394, 24)) +>data : Symbol(data, Decl(variadicTuples1.ts, 410, 5)) +>Unbounded : Symbol(Unbounded, Decl(variadicTuples1.ts, 408, 24)) type U1 = [string, ...Numbers, boolean]; ->U1 : Symbol(U1, Decl(variadicTuples1.ts, 396, 39)) ->Numbers : Symbol(Numbers, Decl(variadicTuples1.ts, 390, 20)) +>U1 : Symbol(U1, Decl(variadicTuples1.ts, 410, 39)) +>Numbers : Symbol(Numbers, Decl(variadicTuples1.ts, 404, 20)) type U2 = [...[string, ...Numbers], boolean]; ->U2 : Symbol(U2, Decl(variadicTuples1.ts, 398, 40)) ->Numbers : Symbol(Numbers, Decl(variadicTuples1.ts, 390, 20)) +>U2 : Symbol(U2, Decl(variadicTuples1.ts, 412, 40)) +>Numbers : Symbol(Numbers, Decl(variadicTuples1.ts, 404, 20)) type U3 = [...[string, number], boolean]; ->U3 : Symbol(U3, Decl(variadicTuples1.ts, 399, 45)) +>U3 : Symbol(U3, Decl(variadicTuples1.ts, 413, 45)) + +// Repro from #53563 + +type ToStringLength1 = `${T['length']}`; +>ToStringLength1 : Symbol(ToStringLength1, Decl(variadicTuples1.ts, 414, 41)) +>T : Symbol(T, Decl(variadicTuples1.ts, 418, 21)) +>T : Symbol(T, Decl(variadicTuples1.ts, 418, 21)) + +type ToStringLength2 = `${[...T]['length']}`; +>ToStringLength2 : Symbol(ToStringLength2, Decl(variadicTuples1.ts, 418, 57)) +>T : Symbol(T, Decl(variadicTuples1.ts, 419, 21)) +>T : Symbol(T, Decl(variadicTuples1.ts, 419, 21)) diff --git a/tests/baselines/reference/variadicTuples1.types b/tests/baselines/reference/variadicTuples1.types index 86b88f9e522..8a955b93ce9 100644 --- a/tests/baselines/reference/variadicTuples1.types +++ b/tests/baselines/reference/variadicTuples1.types @@ -770,6 +770,41 @@ function f15(k0: keyof T, k1: keyof [...T], k2: >'2' : "2" } +// Constraints of variadic tuple types + +function ft16(x: [unknown, unknown], y: [...T, ...T]) { +>ft16 : (x: [unknown, unknown], y: [...T, ...T]) => void +>x : [unknown, unknown] +>y : [...T, ...T] + + x = y; +>x = y : [...T, ...T] +>x : [unknown, unknown] +>y : [...T, ...T] +} + +function ft17(x: [unknown, unknown], y: [...T, ...T]) { +>ft17 : (x: [unknown, unknown], y: [...T, ...T]) => void +>x : [unknown, unknown] +>y : [...T, ...T] + + x = y; +>x = y : [...T, ...T] +>x : [unknown, unknown] +>y : [...T, ...T] +} + +function ft18(x: [unknown, unknown], y: [...T, ...T]) { +>ft18 : (x: [unknown, unknown], y: [...T, ...T]) => void +>x : [unknown, unknown] +>y : [...T, ...T] + + x = y; +>x = y : [...T, ...T] +>x : [unknown, unknown] +>y : [...T, ...T] +} + // Inference between variadic tuple types type First = @@ -1410,3 +1445,11 @@ type U2 = [...[string, ...Numbers], boolean]; type U3 = [...[string, number], boolean]; >U3 : [string, number, boolean] +// Repro from #53563 + +type ToStringLength1 = `${T['length']}`; +>ToStringLength1 : `${T["length"]}` + +type ToStringLength2 = `${[...T]['length']}`; +>ToStringLength2 : `${[...T]["length"]}` + diff --git a/tests/baselines/reference/variadicTuples2.errors.txt b/tests/baselines/reference/variadicTuples2.errors.txt index e68fc8bbed9..afcd81be0c2 100644 --- a/tests/baselines/reference/variadicTuples2.errors.txt +++ b/tests/baselines/reference/variadicTuples2.errors.txt @@ -36,12 +36,12 @@ tests/cases/conformance/types/tuple/variadicTuples2.ts(71,5): error TS2322: Type tests/cases/conformance/types/tuple/variadicTuples2.ts(72,5): error TS2322: Type '[number, ...number[]]' is not assignable to type '[number, ...T]'. Target requires 2 element(s) but source may have fewer. tests/cases/conformance/types/tuple/variadicTuples2.ts(73,5): error TS2322: Type '[number, ...T]' is not assignable to type '[number, number]'. - Variadic element at position 1 in source does not match element at position 1 in target. + Type '[number, ...unknown[]]' is not assignable to type '[number, number]'. + Target requires 2 element(s) but source may have fewer. tests/cases/conformance/types/tuple/variadicTuples2.ts(74,5): error TS2322: Type '[number, ...T]' is not assignable to type '[number, ...number[]]'. - Type at position 1 in source is not compatible with type at position 1 in target. - Type 'T' is not assignable to type 'number[]'. - Type 'unknown[]' is not assignable to type 'number[]'. - Type 'unknown' is not assignable to type 'number'. + Type '[number, ...unknown[]]' is not assignable to type '[number, ...number[]]'. + Type at position 1 in source is not compatible with type at position 1 in target. + Type 'unknown' is not assignable to type 'number'. tests/cases/conformance/types/tuple/variadicTuples2.ts(79,5): error TS2322: Type '[number, string, ...any[]]' is not assignable to type '[number, ...number[]]'. Type at positions 1 through 2 in source is not compatible with type at position 1 in target. Type 'string' is not assignable to type 'number'. @@ -195,14 +195,14 @@ tests/cases/conformance/types/tuple/variadicTuples2.ts(134,25): error TS2345: Ar y = x; // Error ~ !!! error TS2322: Type '[number, ...T]' is not assignable to type '[number, number]'. -!!! error TS2322: Variadic element at position 1 in source does not match element at position 1 in target. +!!! error TS2322: Type '[number, ...unknown[]]' is not assignable to type '[number, number]'. +!!! error TS2322: Target requires 2 element(s) but source may have fewer. z = x; // Error ~ !!! error TS2322: Type '[number, ...T]' is not assignable to type '[number, ...number[]]'. -!!! error TS2322: Type at position 1 in source is not compatible with type at position 1 in target. -!!! error TS2322: Type 'T' is not assignable to type 'number[]'. -!!! error TS2322: Type 'unknown[]' is not assignable to type 'number[]'. -!!! error TS2322: Type 'unknown' is not assignable to type 'number'. +!!! error TS2322: Type '[number, ...unknown[]]' is not assignable to type '[number, ...number[]]'. +!!! error TS2322: Type at position 1 in source is not compatible with type at position 1 in target. +!!! error TS2322: Type 'unknown' is not assignable to type 'number'. } // repro #50216 diff --git a/tests/cases/conformance/types/tuple/variadicTuples1.ts b/tests/cases/conformance/types/tuple/variadicTuples1.ts index 6860a3adc3a..e851e44d568 100644 --- a/tests/cases/conformance/types/tuple/variadicTuples1.ts +++ b/tests/cases/conformance/types/tuple/variadicTuples1.ts @@ -206,6 +206,20 @@ function f15(k0: keyof T, k1: keyof [...T], k2: k3 = '2'; // Error } +// Constraints of variadic tuple types + +function ft16(x: [unknown, unknown], y: [...T, ...T]) { + x = y; +} + +function ft17(x: [unknown, unknown], y: [...T, ...T]) { + x = y; +} + +function ft18(x: [unknown, unknown], y: [...T, ...T]) { + x = y; +} + // Inference between variadic tuple types type First = @@ -402,3 +416,8 @@ const data: Unbounded = [false, false]; // Error type U1 = [string, ...Numbers, boolean]; type U2 = [...[string, ...Numbers], boolean]; type U3 = [...[string, number], boolean]; + +// Repro from #53563 + +type ToStringLength1 = `${T['length']}`; +type ToStringLength2 = `${[...T]['length']}`;