File tree 3 files changed +12
-18
lines changed
3 files changed +12
-18
lines changed Original file line number Diff line number Diff line change @@ -55344,12 +55344,10 @@ function createTypeChecker(host) {
55344
55344
const target = type.target ?? type;
55345
55345
const typeVariable = getHomomorphicTypeVariable(target);
55346
55346
if (typeVariable && !target.declaration.nameType) {
55347
- const constraint = getConstraintTypeFromMappedType(type);
55348
- if (constraint.flags & 4194304 /* Index */) {
55349
- const baseConstraint = getBaseConstraintOfType(constraint.type);
55350
- if (baseConstraint && everyType(baseConstraint, (t) => isArrayOrTupleType(t) || isArrayOrTupleOrIntersection(t))) {
55351
- return instantiateType(target, prependTypeMapping(typeVariable, baseConstraint, type.mapper));
55352
- }
55347
+ const modifiersType = getModifiersTypeFromMappedType(type);
55348
+ const baseConstraint = isGenericMappedType(modifiersType) ? getApparentTypeOfMappedType(modifiersType) : getBaseConstraintOfType(modifiersType);
55349
+ if (baseConstraint && everyType(baseConstraint, (t) => isArrayOrTupleType(t) || isArrayOrTupleOrIntersection(t))) {
55350
+ return instantiateType(target, prependTypeMapping(typeVariable, baseConstraint, type.mapper));
55353
55351
}
55354
55352
}
55355
55353
return type;
Original file line number Diff line number Diff line change @@ -60088,12 +60088,10 @@ function createTypeChecker(host) {
60088
60088
const target = type.target ?? type;
60089
60089
const typeVariable = getHomomorphicTypeVariable(target);
60090
60090
if (typeVariable && !target.declaration.nameType) {
60091
- const constraint = getConstraintTypeFromMappedType(type);
60092
- if (constraint.flags & 4194304 /* Index */) {
60093
- const baseConstraint = getBaseConstraintOfType(constraint.type);
60094
- if (baseConstraint && everyType(baseConstraint, (t) => isArrayOrTupleType(t) || isArrayOrTupleOrIntersection(t))) {
60095
- return instantiateType(target, prependTypeMapping(typeVariable, baseConstraint, type.mapper));
60096
- }
60091
+ const modifiersType = getModifiersTypeFromMappedType(type);
60092
+ const baseConstraint = isGenericMappedType(modifiersType) ? getApparentTypeOfMappedType(modifiersType) : getBaseConstraintOfType(modifiersType);
60093
+ if (baseConstraint && everyType(baseConstraint, (t) => isArrayOrTupleType(t) || isArrayOrTupleOrIntersection(t))) {
60094
+ return instantiateType(target, prependTypeMapping(typeVariable, baseConstraint, type.mapper));
60097
60095
}
60098
60096
}
60099
60097
return type;
Original file line number Diff line number Diff line change @@ -57843,12 +57843,10 @@ ${lanes.join("\n")}
57843
57843
const target = type.target ?? type;
57844
57844
const typeVariable = getHomomorphicTypeVariable(target);
57845
57845
if (typeVariable && !target.declaration.nameType) {
57846
- const constraint = getConstraintTypeFromMappedType(type);
57847
- if (constraint.flags & 4194304 /* Index */) {
57848
- const baseConstraint = getBaseConstraintOfType(constraint.type);
57849
- if (baseConstraint && everyType(baseConstraint, (t) => isArrayOrTupleType(t) || isArrayOrTupleOrIntersection(t))) {
57850
- return instantiateType(target, prependTypeMapping(typeVariable, baseConstraint, type.mapper));
57851
- }
57846
+ const modifiersType = getModifiersTypeFromMappedType(type);
57847
+ const baseConstraint = isGenericMappedType(modifiersType) ? getApparentTypeOfMappedType(modifiersType) : getBaseConstraintOfType(modifiersType);
57848
+ if (baseConstraint && everyType(baseConstraint, (t) => isArrayOrTupleType(t) || isArrayOrTupleOrIntersection(t))) {
57849
+ return instantiateType(target, prependTypeMapping(typeVariable, baseConstraint, type.mapper));
57852
57850
}
57853
57851
}
57854
57852
return type;
You can’t perform that action at this time.
0 commit comments