diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 7a1364c7a1f..bc3bd0ebd8a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -12254,7 +12254,8 @@ namespace ts { else if (target.flags & TypeFlags.IndexedAccess) { // 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))) { + if (relation !== identityRelation && relation !== definitelyAssignableRelation && + !(isGenericObjectType((target).objectType) && isGenericIndexType((target).indexType))) { const constraint = getBaseConstraintOfType(target); if (constraint && constraint !== target) { if (result = isRelatedTo(source, constraint, reportErrors)) {