diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 61bed42969de2..3db7f7f72d9f2 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -15277,8 +15277,7 @@ namespace ts { impliedType = getAssignmentReducedType(impliedType as UnionType, getBaseConstraintOfType(type) || type); } if (isTypeSubtypeOf(impliedType, type)) { - // Intersection to handle `string` being a subtype of `keyof T` - return type.flags & TypeFlags.Any ? impliedType : getIntersectionType([type, impliedType]); + return impliedType; } if (type.flags & TypeFlags.Instantiable) { const constraint = getBaseConstraintOfType(type) || anyType;