assignContextualParameterTypes handles arguments object
Previously, it would crash — the arguments object is a transient symbol with no declaration, and `getEffectiveTypeAnnotationNode` does not accept `undefined`.
This commit is contained in:
parent
eb80799ef0
commit
2fdb5b8659
1 changed files with 2 additions and 1 deletions
|
@ -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(<ParameterDeclaration>parameter.valueDeclaration)) {
|
||||
if (isTransientSymbol(parameter) || !getEffectiveTypeAnnotationNode(<ParameterDeclaration>parameter.valueDeclaration)) {
|
||||
const contextualParameterType = getTypeOfSymbol(lastOrUndefined(context.parameters));
|
||||
assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue