Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ae470a1

Browse files
committedApr 13, 2025·
Fix #61429: check type parameter bounds in maybeTypeOfKind
1 parent f33a6a6 commit ae470a1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
 

‎src/compiler/checker.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39329,6 +39329,13 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
3932939329
}
3933039330
}
3933139331
}
39332+
if (type.flags & TypeFlags.TypeParameter) {
39333+
// The type could be upper-bounded by (a subtype of) the kind.
39334+
const upperBound = getConstraintOfType(type);
39335+
if (upperBound !== undefined && maybeTypeOfKind(upperBound, kind)) {
39336+
return true;
39337+
}
39338+
}
3933239339
return false;
3933339340
}
3933439341

0 commit comments

Comments
 (0)
Please sign in to comment.