(
self,
map: dict[Expression, Type],
node: Expression,
context: Type | None,
allow_none_return: bool = False,
suppress_unreachable_errors: bool = True,
)
| 6053 | return res |
| 6054 | |
| 6055 | def analyze_cond_branch( |
| 6056 | self, |
| 6057 | map: dict[Expression, Type], |
| 6058 | node: Expression, |
| 6059 | context: Type | None, |
| 6060 | allow_none_return: bool = False, |
| 6061 | suppress_unreachable_errors: bool = True, |
| 6062 | ) -> Type: |
| 6063 | with self.chk.binder.frame_context(can_skip=True, fall_through=0): |
| 6064 | if mypy.checker.is_unreachable_map(map): |
| 6065 | # We still need to type check node, in case we want to |
| 6066 | # process it for isinstance checks later. Since the branch was |
| 6067 | # determined to be unreachable, any errors should be suppressed. |
| 6068 | with self.msg.filter_errors(filter_errors=suppress_unreachable_errors): |
| 6069 | self.accept(node, type_context=context, allow_none_return=allow_none_return) |
| 6070 | return UninhabitedType() |
| 6071 | self.chk.push_type_map(map) |
| 6072 | return self.accept(node, type_context=context, allow_none_return=allow_none_return) |
| 6073 | |
| 6074 | def _combined_context(self, ty: Type | None) -> Type | None: |
| 6075 | ctx_items = [] |
no test coverage detected