Skip to content

Commit 730d9ee

Browse files
committed
Don't typecheck unreachable noops
1 parent d5e4a47 commit 730d9ee

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

mypy/checker.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,9 @@ def check_first_pass(self) -> None:
480480
if not self.options.check_unreachable:
481481
break
482482

483+
if not self.options.check_unreachable:
484+
continue
485+
483486
self.accept(d)
484487

485488
assert not self.current_node_deferred
@@ -3145,6 +3148,10 @@ def visit_block(self, b: Block) -> None:
31453148
if not self.options.check_unreachable:
31463149
break
31473150

3151+
if not self.options.check_unreachable:
3152+
# skip checking *anything*, even if it's a noop
3153+
continue
3154+
31483155
self.accept(s)
31493156

31503157
def should_report_unreachable_issues(self) -> bool:

0 commit comments

Comments
 (0)