Skip to content

Commit a187b17

Browse files
committed
Simplify mapped-type handling in computeBaseConstraint
1 parent 1b4f907 commit a187b17

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5968,7 +5968,7 @@ namespace ts {
59685968
function computeBaseConstraint(t: Type): Type {
59695969
if (t.flags & TypeFlags.TypeParameter) {
59705970
const constraint = getConstraintFromTypeParameter(<TypeParameter>t);
5971-
return ((t as TypeParameter).isThisType || !constraint || getObjectFlags(constraint) & ObjectFlags.Mapped) ?
5971+
return (t as TypeParameter).isThisType || !constraint ?
59725972
constraint :
59735973
getBaseConstraint(constraint);
59745974
}
@@ -5998,9 +5998,6 @@ namespace ts {
59985998
const baseIndexedAccess = baseObjectType && baseIndexType ? getIndexedAccessType(baseObjectType, baseIndexType) : undefined;
59995999
return baseIndexedAccess && baseIndexedAccess !== unknownType ? getBaseConstraint(baseIndexedAccess) : undefined;
60006000
}
6001-
if (isGenericMappedType(t)) {
6002-
return emptyObjectType;
6003-
}
60046001
return t;
60056002
}
60066003
}

0 commit comments

Comments
 (0)