-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
bugmypy got something wrongmypy got something wrongtopic-reachabilityDetecting unreachable codeDetecting unreachable code
Description
from typing import NoReturn, Literal
def foo() -> NoReturn: ...
def bar() -> None: ...
def baz(value: Literal["foo"]) -> None:
if value != "foo":
foo() # no error, even though statement is unreachable
if value != "foo":
bar() # error: Statement is unreachable [unreachable]
KotlinIsland and DetachHead
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongtopic-reachabilityDetecting unreachable codeDetecting unreachable code