diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 9347329e624..f8f63bfe0f7 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -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 {