mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-05 16:54:54 -05:00
Address PR comments and fix lint
This commit is contained in:
@@ -3167,8 +3167,7 @@ namespace ts {
|
||||
/** Return the inferred type for a binding element */
|
||||
function getTypeForBindingElement(declaration: BindingElement): Type {
|
||||
const pattern = <BindingPattern>declaration.parent;
|
||||
let parentType = getTypeForBindingElementParent(<VariableLikeDeclaration>pattern.parent);
|
||||
|
||||
const parentType = getTypeForBindingElementParent(<VariableLikeDeclaration>pattern.parent);
|
||||
// If parent has the unknown (error) type, then so does this binding element
|
||||
if (parentType === unknownType) {
|
||||
return unknownType;
|
||||
|
||||
@@ -333,10 +333,8 @@ namespace ts {
|
||||
}
|
||||
else {
|
||||
errorNameNode = declaration.name;
|
||||
let format = TypeFormatFlags.UseTypeOfFunction | TypeFormatFlags.UseTypeAliasValue;
|
||||
if (shouldUseResolverType) {
|
||||
format |= TypeFormatFlags.AddUndefined;
|
||||
}
|
||||
const format = TypeFormatFlags.UseTypeOfFunction | TypeFormatFlags.UseTypeAliasValue |
|
||||
(shouldUseResolverType ? TypeFormatFlags.AddUndefined : 0);
|
||||
resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, format, writer);
|
||||
errorNameNode = undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user