Skip to content

Commit 27bcd4c

Browse files
Update LKG
1 parent 9f33bf1 commit 27bcd4c

File tree

3 files changed

+12
-18
lines changed

3 files changed

+12
-18
lines changed

Diff for: lib/tsc.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -55344,12 +55344,10 @@ function createTypeChecker(host) {
5534455344
const target = type.target ?? type;
5534555345
const typeVariable = getHomomorphicTypeVariable(target);
5534655346
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));
5535355351
}
5535455352
}
5535555353
return type;

Diff for: lib/tsserver.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -60088,12 +60088,10 @@ function createTypeChecker(host) {
6008860088
const target = type.target ?? type;
6008960089
const typeVariable = getHomomorphicTypeVariable(target);
6009060090
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));
6009760095
}
6009860096
}
6009960097
return type;

Diff for: lib/typescript.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -57843,12 +57843,10 @@ ${lanes.join("\n")}
5784357843
const target = type.target ?? type;
5784457844
const typeVariable = getHomomorphicTypeVariable(target);
5784557845
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));
5785257850
}
5785357851
}
5785457852
return type;

0 commit comments

Comments
 (0)