We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b7e8a6d commit c52eb6cCopy full SHA for c52eb6c
src/compiler/checker.ts
@@ -6033,6 +6033,9 @@ namespace ts {
6033
6034
function getIndexedAccessType(objectType: Type, indexType: Type, accessNode?: ElementAccessExpression | IndexedAccessTypeNode) {
6035
if (maybeTypeOfKind(indexType, TypeFlags.TypeVariable | TypeFlags.Index) || isGenericMappedType(objectType)) {
6036
+ if (objectType.flags & TypeFlags.Any) {
6037
+ return objectType;
6038
+ }
6039
// If the index type is generic or if the object type is a mapped type with a generic constraint,
6040
// we are performing a higher-order index access where we cannot meaningfully access the properties
6041
// of the object type. In those cases, we first check that the index type is assignable to 'keyof T'
0 commit comments