diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 5d2b0187eb..8f043d51cd 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -6921,7 +6921,8 @@ namespace ts { // over the conditional type and possibly reduced. For example, 'T extends undefined ? never : T' // removes 'undefined' from T. if (type.root.isDistributive) { - const constraint = getConstraintOfType(getSimplifiedType(type.checkType)); + const simplified = getSimplifiedType(type.checkType); + const constraint = simplified === type.checkType ? getConstraintOfType(simplified) : simplified; if (constraint) { const mapper = makeUnaryTypeMapper(type.root.checkType, constraint); const instantiated = getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper));