diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ff311177629..b3e7b01123d 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -5968,7 +5968,7 @@ namespace ts { function computeBaseConstraint(t: Type): Type { if (t.flags & TypeFlags.TypeParameter) { const constraint = getConstraintFromTypeParameter(t); - return ((t as TypeParameter).isThisType || !constraint || getObjectFlags(constraint) & ObjectFlags.Mapped) ? + return (t as TypeParameter).isThisType || !constraint ? constraint : getBaseConstraint(constraint); } @@ -5998,9 +5998,6 @@ namespace ts { const baseIndexedAccess = baseObjectType && baseIndexType ? getIndexedAccessType(baseObjectType, baseIndexType) : undefined; return baseIndexedAccess && baseIndexedAccess !== unknownType ? getBaseConstraint(baseIndexedAccess) : undefined; } - if (isGenericMappedType(t)) { - return emptyObjectType; - } return t; } }