Instantiation of 'keyof T' for wildcard type produces wildcard type

This commit is contained in:
Anders Hejlsberg 2018-02-14 09:19:47 -08:00
parent f8a378a1d7
commit 3a61f638ba

View file

@ -7948,6 +7948,7 @@ namespace ts {
function getIndexType(type: Type): Type {
return maybeTypeOfKind(type, TypeFlags.InstantiableNonPrimitive) ? getIndexTypeForGenericType(<InstantiableType | UnionOrIntersectionType>type) :
getObjectFlags(type) & ObjectFlags.Mapped ? getConstraintTypeFromMappedType(<MappedType>type) :
type === wildcardType ? wildcardType :
type.flags & TypeFlags.Any || getIndexInfoOfType(type, IndexKind.String) ? stringType :
getLiteralTypeFromPropertyNames(type);
}