Skip to content

Commit 70f6175

Browse files
committed
Obtain apparent type in parameter destructuring check
1 parent 5bc8179 commit 70f6175

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25424,7 +25424,7 @@ namespace ts {
2542425424
if (func.parameters.length >= 2 && isContextSensitiveFunctionOrObjectLiteralMethod(func)) {
2542525425
const contextualSignature = getContextualSignature(func);
2542625426
if (contextualSignature && contextualSignature.parameters.length === 1 && signatureHasRestParameter(contextualSignature)) {
25427-
const restType = getTypeOfSymbol(contextualSignature.parameters[0]);
25427+
const restType = getReducedApparentType(getTypeOfSymbol(contextualSignature.parameters[0]));
2542825428
if (restType.flags & TypeFlags.Union && everyType(restType, isTupleType) && !isSymbolAssigned(symbol)) {
2542925429
const narrowedType = getFlowTypeOfReference(func, restType, restType, /*flowContainer*/ undefined, location.flowNode);
2543025430
const index = func.parameters.indexOf(declaration) - (getThisParameter(func) ? 1 : 0);

0 commit comments

Comments
 (0)