mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-01 13:04:42 -05:00
Check if switch statements are exhaustive when their expressions is generic with a literal type constraint (#60644)
This commit is contained in:
committed by
GitHub
parent
97177722b8
commit
14c65b3119
@@ -38682,7 +38682,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
// A missing not-equal flag indicates that the type wasn't handled by some case.
|
||||
return !someType(operandConstraint, t => getTypeFacts(t, notEqualFacts) === notEqualFacts);
|
||||
}
|
||||
const type = checkExpressionCached(node.expression);
|
||||
const type = getBaseConstraintOrType(checkExpressionCached(node.expression));
|
||||
if (!isLiteralType(type)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user