Skip to content

Commit b239c2a

Browse files
author
Orta
authored
Merge pull request #31366 from ypresto/fix-comment-unknown
Fix outdated comments for unknown type
2 parents 79598af + d17e662 commit b239c2a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/compiler/checker.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -7676,7 +7676,7 @@ namespace ts {
76767676
else {
76777677
// Otherwise, get the declared constraint type, and if the constraint type is a type parameter,
76787678
// get the constraint of that type parameter. If the resulting type is an indexed type 'keyof T',
7679-
// the modifiers type is T. Otherwise, the modifiers type is {}.
7679+
// the modifiers type is T. Otherwise, the modifiers type is unknown.
76807680
const declaredType = <MappedType>getTypeFromMappedTypeNode(type.declaration);
76817681
const constraint = getConstraintTypeFromMappedType(declaredType);
76827682
const extendedConstraint = constraint && constraint.flags & TypeFlags.TypeParameter ? getConstraintOfTypeParameter(<TypeParameter>constraint) : constraint;
@@ -23360,7 +23360,7 @@ namespace ts {
2336023360
links.type = contextualType;
2336123361
const decl = parameter.valueDeclaration as ParameterDeclaration;
2336223362
if (decl.name.kind !== SyntaxKind.Identifier) {
23363-
// if inference didn't come up with anything but {}, fall back to the binding pattern if present.
23363+
// if inference didn't come up with anything but unknown, fall back to the binding pattern if present.
2336423364
if (links.type === unknownType) {
2336523365
links.type = getTypeFromBindingPattern(decl.name);
2336623366
}

0 commit comments

Comments
 (0)