Skip to content

Commit ec6b98d

Browse files
committed
Try to fix spurious unreachability warnings
1 parent 1dd8690 commit ec6b98d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

mypy/checkexpr.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5495,7 +5495,8 @@ def visit_lambda_expr(self, e: LambdaExpr) -> Type:
54955495
# Lambdas can have more than one element in body,
54965496
# when we add "fictional" AssignmentStatement nodes, like in:
54975497
# `lambda (a, b): a`
5498-
self.chk.accept(e.body)
5498+
with self.chk.binder.frame_context(can_skip=True, fall_through=0):
5499+
self.chk.accept(e.body)
54995500

55005501
# Only type check the return expression, not the return statement.
55015502
# There's no useful type context.

0 commit comments

Comments
 (0)