mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-09 16:39:46 -05:00
Properly handle mapped types with 'keyof any'
This commit is contained in:
@@ -5777,7 +5777,7 @@ namespace ts {
|
||||
for (const propertySymbol of getPropertiesOfType(modifiersType)) {
|
||||
addMemberForKeyType(getLiteralTypeFromPropertyName(propertySymbol), propertySymbol);
|
||||
}
|
||||
if (getIndexInfoOfType(modifiersType, IndexKind.String)) {
|
||||
if (modifiersType.flags & TypeFlags.Any || getIndexInfoOfType(modifiersType, IndexKind.String)) {
|
||||
addMemberForKeyType(stringType);
|
||||
}
|
||||
}
|
||||
@@ -8386,7 +8386,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
function isMappableType(type: Type) {
|
||||
return type.flags & (TypeFlags.TypeParameter | TypeFlags.Object | TypeFlags.Intersection | TypeFlags.IndexedAccess);
|
||||
return type.flags & (TypeFlags.Any | TypeFlags.TypeParameter | TypeFlags.Object | TypeFlags.Intersection | TypeFlags.IndexedAccess);
|
||||
}
|
||||
|
||||
function instantiateAnonymousType(type: AnonymousType, mapper: TypeMapper): AnonymousType {
|
||||
|
||||
Reference in New Issue
Block a user