Skip to content

Commit c0f0243

Browse files
author
Matt
committed
Add: Set "NodeCheckFlags.EmitRestParam" flag on parameter declaration node, in
the "checkIdentifier" function, if the parameter is a rest parameter.
1 parent 7dad540 commit c0f0243

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/compiler/checker.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12622,6 +12622,14 @@ namespace ts {
1262212622
// or parameter. The flow container is the innermost function starting with which we analyze the control
1262312623
// flow graph to determine the control flow based type.
1262412624
const isParameter = getRootDeclaration(declaration).kind === SyntaxKind.Parameter;
12625+
12626+
if (isParameter) {
12627+
const parameterDeclaration = getRootDeclaration(declaration) as ParameterDeclaration;
12628+
if (parameterDeclaration.dotDotDotToken) {
12629+
getNodeLinks(parameterDeclaration).flags |= NodeCheckFlags.EmitRestParam;
12630+
}
12631+
}
12632+
1262512633
const declarationContainer = getControlFlowContainer(declaration);
1262612634
let flowContainer = getControlFlowContainer(node);
1262712635
const isOuterVariable = flowContainer !== declarationContainer;

0 commit comments

Comments
 (0)