Skip to content

Commit

Permalink
revert predicate change
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist committed Oct 31, 2023
1 parent bc15c38 commit ec113c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18313,7 +18313,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
return constraint && (isGenericObjectType(constraint) || isGenericIndexType(constraint)) ? cloneTypeParameter(p) : p;
}

function isSimpleTupleType(node: TypeNode): node is TupleTypeNode {
function isSimpleTupleType(node: TypeNode): boolean {
return isTupleTypeNode(node) && length(node.elements) > 0 &&
!some(node.elements, e => isOptionalTypeNode(e) || isRestTypeNode(e) || isNamedTupleMember(e) && !!(e.questionToken || e.dotDotDotToken));
}
Expand Down Expand Up @@ -18350,7 +18350,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
// conditional type when any tuple elements are generic. This is such that non-distributable conditional
// types can be written `[X] extends [Y] ? ...` and be deferred similarly to `X extends Y ? ...`.
const checkTuples = isSimpleTupleType(checkTypeNode) && isSimpleTupleType(extendsTypeNode) &&
length(checkTypeNode.elements) === length(extendsTypeNode.elements);
length((checkTypeNode as TupleTypeNode).elements) === length((extendsTypeNode as TupleTypeNode).elements);
const checkTypeDeferred = isDeferredType(checkType, checkTuples);
let combinedMapper: TypeMapper | undefined;
if (root.inferTypeParameters) {
Expand Down

0 comments on commit ec113c0

Please sign in to comment.