8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
__exit__
None
1 parent 8ae021c commit 5763cf1Copy full SHA for 5763cf1
packages/pyright-internal/src/analyzer/codeFlowEngine.ts
@@ -1493,8 +1493,7 @@ export function getCodeFlowEngine(
1493
const exitType = evaluator.getTypeOfObjectMember(node, cmType, exitMethodName)?.type;
1494
1495
if (exitType && isFunction(exitType) && exitType.details.declaredReturnType) {
1496
- const returnType = exitType.details.declaredReturnType;
1497
- cmSwallowsExceptions = isClassInstance(returnType) && ClassType.isBuiltIn(returnType, 'bool');
+ cmSwallowsExceptions = evaluator.canBeTruthy(exitType.details.declaredReturnType);
1498
}
1499
1500
} finally {
0 commit comments