Skip to content

Commit 3e5efd1

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 0f498de commit 3e5efd1

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
@@ -12611,6 +12611,14 @@ namespace ts {
1261112611
// or parameter. The flow container is the innermost function starting with which we analyze the control
1261212612
// flow graph to determine the control flow based type.
1261312613
const isParameter = getRootDeclaration(declaration).kind === SyntaxKind.Parameter;
12614+
12615+
if (isParameter) {
12616+
const parameterDeclaration = getRootDeclaration(declaration) as ParameterDeclaration;
12617+
if (parameterDeclaration.dotDotDotToken) {
12618+
getNodeLinks(parameterDeclaration).flags |= NodeCheckFlags.EmitRestParam;
12619+
}
12620+
}
12621+
1261412622
const declarationContainer = getControlFlowContainer(declaration);
1261512623
let flowContainer = getControlFlowContainer(node);
1261612624
const isOuterVariable = flowContainer !== declarationContainer;

0 commit comments

Comments
 (0)