Skip to content

Commit c2cd4f6

Browse files
committed
Address PR comments and fix lint
1 parent 6328e6c commit c2cd4f6

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3167,8 +3167,7 @@ namespace ts {
31673167
/** Return the inferred type for a binding element */
31683168
function getTypeForBindingElement(declaration: BindingElement): Type {
31693169
const pattern = <BindingPattern>declaration.parent;
3170-
let parentType = getTypeForBindingElementParent(<VariableLikeDeclaration>pattern.parent);
3171-
3170+
const parentType = getTypeForBindingElementParent(<VariableLikeDeclaration>pattern.parent);
31723171
// If parent has the unknown (error) type, then so does this binding element
31733172
if (parentType === unknownType) {
31743173
return unknownType;

src/compiler/declarationEmitter.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,10 +333,8 @@ namespace ts {
333333
}
334334
else {
335335
errorNameNode = declaration.name;
336-
let format = TypeFormatFlags.UseTypeOfFunction | TypeFormatFlags.UseTypeAliasValue;
337-
if (shouldUseResolverType) {
338-
format |= TypeFormatFlags.AddUndefined;
339-
}
336+
const format = TypeFormatFlags.UseTypeOfFunction | TypeFormatFlags.UseTypeAliasValue |
337+
(shouldUseResolverType ? TypeFormatFlags.AddUndefined : 0);
340338
resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, format, writer);
341339
errorNameNode = undefined;
342340
}

0 commit comments

Comments
 (0)