Skip to content

Commit e2684f1

Browse files
committed
Run formatter
1 parent 0c24ccc commit e2684f1

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

Diff for: src/compiler/checker.ts

+10-7
Original file line numberDiff line numberDiff line change
@@ -15462,11 +15462,13 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
1546215462
signature.resolvedTypePredicate = type && isTypePredicateNode(type) ?
1546315463
createTypePredicateFromTypePredicateNode(type, signature) :
1546415464
jsdocPredicate || noTypePredicate;
15465-
} else if (signature.declaration && isFunctionLikeDeclaration(signature.declaration) && (!signature.resolvedReturnType || signature.resolvedReturnType === booleanType)) {
15466-
const {declaration} = signature;
15467-
signature.resolvedTypePredicate = noTypePredicate; // avoid infinite loop
15465+
}
15466+
else if (signature.declaration && isFunctionLikeDeclaration(signature.declaration) && (!signature.resolvedReturnType || signature.resolvedReturnType === booleanType)) {
15467+
const { declaration } = signature;
15468+
signature.resolvedTypePredicate = noTypePredicate; // avoid infinite loop
1546815469
signature.resolvedTypePredicate = getTypePredicateFromBody(declaration, signature) || noTypePredicate;
15469-
} else {
15470+
}
15471+
else {
1547015472
signature.resolvedTypePredicate = noTypePredicate;
1547115473
}
1547215474
}
@@ -37405,7 +37407,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
3740537407
let singleReturn: Expression | undefined;
3740637408
if (func.body && func.body.kind !== SyntaxKind.Block) {
3740737409
singleReturn = func.body; // arrow function
37408-
} else {
37410+
}
37411+
else {
3740937412
if (functionHasImplicitReturn(func)) return undefined;
3741037413

3741137414
const bailedEarly = forEachReturnStatement(func.body as Block, returnStatement => {
@@ -37445,7 +37448,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
3744537448
}
3744637449

3744737450
function checkIfExpressionRefinesParameter(expr: Expression, param: ParameterDeclaration, initType: Type): Type | undefined {
37448-
const antecedent = (expr as Expression & {flowNode?: FlowNode}).flowNode ?? { flags: FlowFlags.Start };
37451+
const antecedent = (expr as Expression & { flowNode?: FlowNode; }).flowNode ?? { flags: FlowFlags.Start };
3744937452
const trueCondition: FlowCondition = {
3745037453
flags: FlowFlags.TrueCondition,
3745137454
node: expr,
@@ -37462,7 +37465,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
3746237465
const falseCondition: FlowCondition = {
3746337466
...trueCondition,
3746437467
flags: FlowFlags.FalseCondition,
37465-
}
37468+
};
3746637469
const falseType = getFlowTypeOfReference(param.name, initType, initType, func, falseCondition);
3746737470
const candidateFalse = filterType(initType, t => !isTypeSubtypeOf(t, trueType));
3746837471
if (isTypeIdenticalTo(candidateFalse, falseType)) {

0 commit comments

Comments
 (0)