From d17e662bca3701f3be6e0d5c461894ad3511eaa9 Mon Sep 17 00:00:00 2001 From: Yuya Tanaka Date: Mon, 13 May 2019 16:45:56 +0900 Subject: [PATCH] Fix outdated comments for unknown type --- src/compiler/checker.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 64834befee1c8..42e5dc91e63b5 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -7474,7 +7474,7 @@ namespace ts { else { // Otherwise, get the declared constraint type, and if the constraint type is a type parameter, // get the constraint of that type parameter. If the resulting type is an indexed type 'keyof T', - // the modifiers type is T. Otherwise, the modifiers type is {}. + // the modifiers type is T. Otherwise, the modifiers type is unknown. const declaredType = getTypeFromMappedTypeNode(type.declaration); const constraint = getConstraintTypeFromMappedType(declaredType); const extendedConstraint = constraint && constraint.flags & TypeFlags.TypeParameter ? getConstraintOfTypeParameter(constraint) : constraint; @@ -22570,7 +22570,7 @@ namespace ts { links.type = contextualType; const decl = parameter.valueDeclaration as ParameterDeclaration; if (decl.name.kind !== SyntaxKind.Identifier) { - // if inference didn't come up with anything but {}, fall back to the binding pattern if present. + // if inference didn't come up with anything but unknown, fall back to the binding pattern if present. if (links.type === unknownType) { links.type = getTypeFromBindingPattern(decl.name); }