diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 611b6c4d4b0..58e6075198a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11876,8 +11876,9 @@ namespace ts { } } else if (target.flags & TypeFlags.IndexedAccess) { - // A type S is related to a type T[K] if S is related to C, where C is the base constraint of T[K] - if (relation !== identityRelation) { + // A type S is related to a type T[K], where T and K aren't both type variables, if S is related to C, + // where C is the base constraint of T[K] + if (relation !== identityRelation && !(isGenericObjectType((target).objectType) && isGenericIndexType((target).indexType))) { const constraint = getBaseConstraintOfType(target); if (constraint && constraint !== target) { if (result = isRelatedTo(source, constraint, reportErrors)) {