mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-07 05:41:22 -06:00
Simplify mapped-type handling in computeBaseConstraint
This commit is contained in:
parent
1b4f90705f
commit
a187b17e97
@ -5968,7 +5968,7 @@ namespace ts {
|
||||
function computeBaseConstraint(t: Type): Type {
|
||||
if (t.flags & TypeFlags.TypeParameter) {
|
||||
const constraint = getConstraintFromTypeParameter(<TypeParameter>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;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user