mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-19 10:41:56 -05:00
Preserve partially typed tuple names in more places (#55789)
This commit is contained in:
@@ -33356,8 +33356,11 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
if (arg.kind === SyntaxKind.SyntheticExpression && (arg as SyntheticExpression).tupleNameSource) {
|
||||
names.push((arg as SyntheticExpression).tupleNameSource!);
|
||||
}
|
||||
else {
|
||||
names.push(undefined);
|
||||
}
|
||||
}
|
||||
return createTupleType(types, flags, inConstContext && !someType(restType, isMutableArrayLikeType), length(names) === length(types) ? names : undefined);
|
||||
return createTupleType(types, flags, inConstContext && !someType(restType, isMutableArrayLikeType), names);
|
||||
}
|
||||
|
||||
function checkTypeArguments(signature: Signature, typeArgumentNodes: readonly TypeNode[], reportErrors: boolean, headMessage?: DiagnosticMessage): Type[] | undefined {
|
||||
@@ -35741,12 +35744,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
types.push(restType);
|
||||
flags.push(ElementFlags.Variadic);
|
||||
}
|
||||
const name = getNameableDeclarationAtPosition(source, i);
|
||||
if (name) {
|
||||
names.push(name);
|
||||
}
|
||||
names.push(getNameableDeclarationAtPosition(source, i));
|
||||
}
|
||||
return createTupleType(types, flags, readonly, length(names) === length(types) ? names : undefined);
|
||||
return createTupleType(types, flags, readonly, names);
|
||||
}
|
||||
|
||||
// Return the number of parameters in a signature. The rest parameter, if present, counts as one
|
||||
|
||||
Reference in New Issue
Block a user