Fixed types of properties of contextual filtering mapped types (#56201)

This commit is contained in:
Mateusz Burzyński
2024-08-08 08:58:20 -07:00
committed by GitHub
parent 99878128f0
commit 3cf708e179
4 changed files with 251 additions and 1 deletions
+1 -1
View File
@@ -31620,7 +31620,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
function getTypeOfPropertyOfContextualType(type: Type, name: __String, nameType?: Type) {
return mapType(type, t => {
if (isGenericMappedType(t) && !t.declaration.nameType) {
if (isGenericMappedType(t) && getMappedTypeNameTypeKind(t) !== MappedTypeNameTypeKind.Remapping) {
const constraint = getConstraintTypeFromMappedType(t);
const constraintOfConstraint = getBaseConstraintOfType(constraint) || constraint;
const propertyNameType = nameType || getStringLiteralType(unescapeLeadingUnderscores(name));