Fix regression in name resolution in parameter (#38351)

This commit is contained in:
Ron Buckton
2020-05-06 12:04:28 -07:00
committed by GitHub
parent ec93a7cf7b
commit 4b08c0582d
2 changed files with 16 additions and 1 deletions

View File

@@ -1889,7 +1889,9 @@ namespace ts {
lastLocation === (location as BindingElement).name && isBindingPattern(lastLocation))) {
const root = getRootDeclaration(location);
if (root.kind === SyntaxKind.Parameter) {
associatedDeclarationForContainingInitializerOrBindingName = location as BindingElement;
if (!associatedDeclarationForContainingInitializerOrBindingName) {
associatedDeclarationForContainingInitializerOrBindingName = location as BindingElement;
}
}
}
break;