Skip to content

(🐞) 'warn-unreachable' doesn't reactivate after it is suppressed with a <nothing> statement #11437

Closed
@KotlinIsland

Description

@KotlinIsland
from typing import NoReturn

def foo() -> NoReturn:
    raise Exception

def bar() -> NoReturn:
    foo()
    foo()
    print("hi")  # no warning

The first call to foo is suppress the unreachable intentionally, (same with the second). But the print("hi) should definitely show an unreachable error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrongtopic-reachabilityDetecting unreachable code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions