mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-12-12 11:50:54 -06:00
Merge pull request #31366 from ypresto/fix-comment-unknown
Fix outdated comments for unknown type
This commit is contained in:
commit
b239c2a90e
@ -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);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user