Merge pull request #31366 from ypresto/fix-comment-unknown

Fix outdated comments for unknown type
This commit is contained in:
Orta 2019-08-07 11:23:43 -04:00 committed by GitHub
commit b239c2a90e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7676,7 +7676,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 = <MappedType>getTypeFromMappedTypeNode(type.declaration);
const constraint = getConstraintTypeFromMappedType(declaredType);
const extendedConstraint = constraint && constraint.flags & TypeFlags.TypeParameter ? getConstraintOfTypeParameter(<TypeParameter>constraint) : constraint;
@ -23360,7 +23360,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);
}