diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ff5d1c661e8..b8b2e8edb82 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -16665,8 +16665,9 @@ namespace ts { } } if (signature.hasRestParameter && isRestParameterIndex(context, signature.parameters.length - 1)) { + // parameter might be a transient symbol generated by use of `arguments` in the function body. const parameter = lastOrUndefined(signature.parameters); - if (!getEffectiveTypeAnnotationNode(parameter.valueDeclaration)) { + if (isTransientSymbol(parameter) || !getEffectiveTypeAnnotationNode(parameter.valueDeclaration)) { const contextualParameterType = getTypeOfSymbol(lastOrUndefined(context.parameters)); assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType); }