mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Remove incorrect call to checkTruthinessExpression (#59507)
This commit is contained in:
@@ -44186,7 +44186,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
bothHelper(location, body);
|
||||
return;
|
||||
}
|
||||
const type = location === condExpr ? condType : checkTruthinessExpression(location);
|
||||
const type = location === condExpr ? condType : checkExpression(location);
|
||||
if (type.flags & TypeFlags.EnumLiteral && isPropertyAccessExpression(location) && (getNodeLinks(location.expression).resolvedSymbol ?? unknownSymbol).flags & SymbolFlags.Enum) {
|
||||
// EnumLiteral type at condition with known value is always truthy or always falsy, likely an error
|
||||
error(location, Diagnostics.This_condition_will_always_return_0, !!(type as LiteralType).value ? "true" : "false");
|
||||
|
||||
Reference in New Issue
Block a user